Serial ports use 4 pins?

Status
Not open for further replies.

sixeight

Well-known member
On the teensy-LC pinout port 0 and 1 are RX1 and TX1. But also port 3 and 4 are labeled RX1 and TX1. Why is this? Can I still use port 3 and 4 for other purposes?
 
But also port 3 and 4 are labeled RX1 and TX1. Why is this?

It's possible with software to reassign the signals to those other pins.

Can I still use port 3 and 4 for other purposes?

Yes, you can.

By default, the pins where RX1 and TX1 are shown in dark black font will be used (pins 0 and 1).

The alternate pins are shown in a lighter gray font. When you use Serial1.begin(baud) in your program, those pins will be unaffected. Switching the signals to those alternate pins requires some special code to write to the chip's pin config registers.

Usually, most people never need this. But it can come in very handy. For example, if you need to use Serial1 and you also want to connect several touch sensitive pads for a user interface with touchRead(), you might want to use pins 0 and 1 for touch sensors. Without the ability to reassign signals, you'd simply be out of luck. But with some software fiddling, you can reassign RX1 to pin 3 or pin 21, and TX1 to pin 4 or pin 5.
 
The black vs gray font was meant to communicate default vs alternate pins.

We're pretty constrained for space on those pinout cards.... but from your perspective of seeing this for the very first time, any ideas on what we might be able to print on that card to better communicate this concept?
 
I was a little confused by this too. I assumed they were alternate locations but there's really nothing on there that mentions how to use the alternates.

You could possibly add a legend or footnote saying something along the lines of "Pins in grey text are alternate pin locations, read more at pjrc.com/teensy/AlternatePins".
 
If I read the documentation at pjrc.com, the first page on i/o pins is this one: https://www.pjrc.com/teensy/pins.html

I find this one quite confusing, because it starts out with code that is not easy to understand for a newbie like me. I did learn c++ when I was in college, but that was 25 years ago. I would have expected an explanation of the different port types digital/analog/serial/etc. with short examples of the use.

Once that is in place, the card just needs a link to this page.
 
FWIW, I created a spreadsheet with google drive for my own uses to summarize the pin assignments of various microprocessors. I attempted show the differences between variants such as Teensy 3.0, 3.1, and LC: https://docs.google.com/spreadsheets/d/1LSi0c17iqtvpKuNSYksMG306_FpWdJcniSRR6aGNNYQ/edit?usp=sharing.

Note, you will need a browser with a wide display to view it. I suspect it may be hard to read with people with some kinds of color blindness due to using different colors to indicate difference.
 
Status
Not open for further replies.
Back
Top