Serial2 not working on pins 26 & 31 (Teensy 3.1)
I have a problem with using serial2 on pins 26 & 31. What I want to do is read images from a VC0706 serial CMOS camera.
Using standard serial1 ports (0 & 1), it does work. As I need them for other peripherals I decided to connect the camera to the alternative pins on HardwareSerial2.
I found this thread: http://forum.pjrc.com/threads/25357-Serial2-on-pad-26-and-31-on-Teensy-3-1 where a user wanted to do the same.
The proposal was:
So I went into the file "mk20dx128.h" and changed the two lines as followed:
Instead of passing the Serial1 object to the camera, I am now using : "Camera cam = Camera(&Serial2);"
Unfortunately, the cam is not responding on those new ports. Am I missing something ?
Thanks for your help !
I have a problem with using serial2 on pins 26 & 31. What I want to do is read images from a VC0706 serial CMOS camera.
Using standard serial1 ports (0 & 1), it does work. As I need them for other peripherals I decided to connect the camera to the alternative pins on HardwareSerial2.
I found this thread: http://forum.pjrc.com/threads/25357-Serial2-on-pad-26-and-31-on-Teensy-3-1 where a user wanted to do the same.
The proposal was:
Code:
To connect these, the following registers need to be set
PORTE_PCR0 = 0x00000300 (mux 3) - connects alternative function UART1_TX to pin PTE0
PORTE_PCR1 = 0x00000300 (mux 3) - connects alternative function UART1_RX to pin PTE1
So I went into the file "mk20dx128.h" and changed the two lines as followed:
Code:
#define PORTE_PCR0 *(volatile uint32_t *)0x00000300 // Pin Control Register n
#define PORTE_PCR1 *(volatile uint32_t *)0x00000300 // Pin Control Register n
Instead of passing the Serial1 object to the camera, I am now using : "Camera cam = Camera(&Serial2);"
Unfortunately, the cam is not responding on those new ports. Am I missing something ?
Thanks for your help !
Last edited: