Accessing "Serial port 2" using the Teensy 3.2 bottom pads.

Status
Not open for further replies.

jwhalin

New member
Can someone help me?
I read the “Welcome to Teensy 3.2” reference card (back side) as RX2-TX2 being accessed through pads 26 & 31 respectively.
Is this correct?
Is there a unique way to address the pads 26-31 vs. header pins 9-10 for serial port 2? (I need pins 9,10 for digital I/O)
Thanks, Jeff
 
Call these methods on Serial2
Code:
        virtual void setRX(uint8_t pin) {
        virtual void setTX(uint8_t pin, bool opendrain=false) {
 
Indeed - should work when called like this:
Code:
	Serial2.begin(9600);
	Serial2.setRX (26);
	Serial2.setTX (31);
 
Slight note:
I believe you can call the functions like setRX before or after the Serial2.begin...

However if you do it in the order:
Code:
        Serial2.begin(9600);
	Serial2.setRX (26);
	Serial2.setTX (31);
The Serial2.begin will first setup the default pins to be in Serial mode, and then the two set functions will then set the default pins back to disabled and then set the new pins to Serial mode.

If you call it in the order:
Code:
	Serial2.setRX (26);
	Serial2.setTX (31);
        Serial2.begin(9600);
The set functions will just remember which pin you selected and then when you call begin those pins will be setup in Serial mode and the default pins will not be touched.

But both ways should work
 
Status
Not open for further replies.
Back
Top