Ability to write to Serial3 TX port---doesn't seem to work

Status
Not open for further replies.

KrisKasprzak

Well-known member
All,

I have a project where I'm using a GPS sensor connected to Teensy 3.2 Serial3 port--the GPS sensor is mounted on a small PCB board and a USB cable between it and my Teensy 3.2 (which is mounted on a custom PCB board as well).

I'm getting data from the GPS sensor (sent from GPS Tx port and read on Teensy Rx port, pin 7), all is well. I was hoping to be able to illuminate a small LED on the GPS sensor via digitalWrite(8, HIGH) and send through Serial3 Tx port as I'm not using the Tx port on the teensy.

The LED stays high. If I comment out my MyGPSSerial.begin(9600); line i can write to the LED through the Port. See my cheezy drawing. Note PCB boards are printed, etc. so i CAN just use a different digital pin.

I'm guessing i can't manually send a high/low signal through Serial3 Tx port. Any way to force teensy to let me write to Tx pin (pin 7)?

Thanks


GPS.png
 
Any way to force teensy to let me write to Tx pin (pin 7)?

Yes.

Code:
pinMode(7, OUTPUT);

On Teensy 3.2, every pin has a mux which allows 1 of 8 things to control the pin.

Serial3.begin() writes to the mux to cause both the pins to become controlled by the serial port.

pinMode() writes to the mux to cause a pin to be controlled by GPIO.
 
Yep, that was it. I had pinMode(8, OUTPUT); but that statement was before the GPSSerial.begin(9600);

Once i moved the pinMode after the .begin(), my system worked as expected.

Thanks a million!
 
Status
Not open for further replies.
Back
Top