Serial port on Teensy4.1

Status
Not open for further replies.

pd0lew

Well-known member
Hi all,

In my previous project with a Teensy 3.6 I used Serial port 4 at 2400 baud (Serial.begin(2400); Now I rewrite my program for a Teensy 4.1 and used Serial port 7, Serial7.begin(2400); This is not working ... what can be the problem?

Please help this is the only thing in my project what is not working.

Thanks,
Johan Holstein
 
This is not working ... what can be the problem?

Maybe the wires aren't connected properly? Or maybe there's a mistake somewhere in your program? All it would take is one "Serial4" not changed to "Serial7", sort of like how your message has "Serial.begin(2400)" where you meant "Serial4.begin(2400)".

One thing I can confirm is not the problem is whether Serial7 works at 2400 baud. I tested it just now, using File > Examples > Teensy > Serial > EchoBoth, with these lines edited:

Code:
// set this to the hardware serial port you wish to use
#define HWSERIAL Serial7

void setup() {
	Serial.begin(9600);
	HWSERIAL.begin(2400);
}

It definitely works. I ran "seyon" on Linux to talk to the FTDI cable, and the Arduino Serial Monitor to talk to Teensy 4.1. Anything sent from either side appears on both.

serial7.jpg
 
What is not working?
I did a quick and dirty program that opened Serial7 (pins 28 and 29)
First I verified that it should be able to create that baud.
Then I did simple output with counter and saw the data on Logic Analyzer.
Than added simple loop read and it is echoing...

So I think it is working
 
Hi all,

There where two issues at my place first the level shifter was wrong and second I reversed TX and RX. Everything is working fine now.

I feel a bit dumm and sorry for bothering the group!

Thanks for helping!

Best regards,
Johan
 
Status
Not open for further replies.
Back
Top