Can the Software Serial Library control the comms of three different RS485 comm ports? If not can this library be tweaked to run 3 comm ports on a Nano?

I have setup a circuit with three “SN75176” chips using software serial library, all three transmitt okay, but none of three chips receive.

When I change the sketch to only drive one chip trans/receive works okay.

It's all in the docs if you read them.


Limitations The library has the following known limitations:

If using multiple software serial ports, only one can receive data at a time. ...

Which leads to this link from that same page:

There are alternative libraries; AltSoftSerial and NeoSWSerial. User -dev posted a reply to a question last year explaining the differences; one I could find is but there might have been a better one.

I have never used any of them but to my knowledge, NeoSWSerial is probably the preferred one in this case. Give it a try; not sure if it can do 3 instances.

An Arduino Mega can make life a lot simpler; 3 additional hardware serial ports. An Arduino Micro provides a free hardware serial port so two NeoSWSerial and one hardware serial could possibly solve your problem.

It's time to step up to more hardware serial ports. A Teensy 3.2 is smaller than a Nano and has 3 Serial plus USB serial.

The only combination that might work is to use one Serial (pins 0 and 1), one AltSoftSerial (pins 8 & 9) and one NeoSWSerial (any two pins). You would not need to call listen, because they would all be receiving at the same time.

All three can coexist, but there is one limitation*:* transmitting on NeoSWSerial will prevent receiving on AltSoftSerial. If there is some predictable timing for receiving on AltSoftSerial, you could coordinate the transmission on NeoSWSerial to avoid losing data.

If you need to be able to receive characters at [u]any[/u] time from any port, and you need to transmit on all ports at some time, you will need a different Arduino.