Go Down

Topic: Software Serial on Leonardo question (Read 811 times) previous topic - next topic


I see that software serial pins can only be used for RX pins on pins 8,9,10,11,14,15,16 on the Leonardo. My questions is can any pin be a TX pin though?  I'm primarily interested in using pins 2,3,4,5 as input TX pins is that possible?  I have a design that I'm porting over from an older Arduino and the boards are already made so the minimal bond wires I need to change in traces the better.

Nick Gammon

As far as I know the limitation on the Rx pins is because of which pins are supported by pin-change interrupts. You don't need to worry about that on the Tx pins.
Please post technical questions on the forum, not by personal message. Thanks!

More info:


I'm primarily interested in using pins 2,3,4,5 as input TX pins is that possible?

You are aware, I hope, that only one instance of SoftwareSerial can be in receive mode at one time. All others will ignore any serial data that arrives on other pins.


I'm primarily interested in using pins 2,3,4,5 as input TX pins is that possible?

TX means transmit, so this pin is an output by definition. The term "input TX" is a contradiction in itself.

In SoftwareSerial any GPIO can be used as a TX pin, so on the Leonardo any of the 20 pins can be used for that.


Pylon you are correct there was a typo in my original post.  forgot the word input is there.  

The intent of my question was to verifying that software serial on the Leonardo can use any pin.  I have been using a board for many years that I had made with a ATMEGA328p-pu on it and I recently just had the board re-spun using an ATMEGA32U4 and reduced the overall size of the board.  Since they are 6 layer boards that are very expensive I do not want to re-spin the boards.  On my old board i was using 0,1 as a hardware serial port 2,3 as a software serial port 4,5 as a software serial port and 6,7 as a software serial port.  Since re-spinig my 6 layer boards cost over $1500 between the boards and parts, I'd rather white wire the boards. This should correct my over sight and I plan on switching the software serial pins to (14,3):(16,5):(15,7) respectively from their previous situation.  Just trying to cut down on the reprogramming and white wiring to 3 wires verse and 6.


As has been mentioned, SoftwareSerial uses pin change interrupts to detect incoming data. It does NOT use pin change interrupts to send data. So, input needs to be on a pin that supports pin change interrupts. Output does not need to be constrained.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131