Pages: [1]   Go Down
Author Topic: Software Serial on Leonardo question  (Read 553 times)
0 Members and 1 Guest are viewing this topic.
Orlando, FL
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 472
Posts: 18693
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 600
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Orlando, FL
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 600
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: