Can I run several bits of hardware off the TXD and RXD pins?

Hi all,

I am planning to wire up a SIM800L, RFM95 and ESP8266 WiFi module all of which use the TXD and RXD pins.

Can I wire them all up to the TXD and RXD pins or will that cause problems?

Thanks very much,

Zeb

"Can I wire them all up to the TXD and RXD pins or will that cause problems?"

Do the other components have TTL tx and rx pins? Electrically they might all exist ok together, but operationally there could be communication conflict issues. It just depends on the components themselves and how you plan to use them.

Hi zoomkat,

Thanks very much for your help I now know what I needed to know.

Thanks again,

Zeb

It will cause problems. Use 2 additional software serial ports for Your slower/least used devices.

You can wire serial Tx to multiple Rx receivers. But then the issue becomes “how do I tell device X to ignore the data I am sending device Y?”. There’s no way to do that without external hardware to switch which individual device you are talking to.

With multiple Tx connecting to one Rx on the Arduino you are going to case a short. Don’t do that! So again you need external hardware to multiplex the inputs so only one is connected at any one time. And then you have the problem “what if device Y starts sending data when I am listening to device X?”.

There are workarounds for all these issues, but none of them are at all easy. The simple answers are…

  1. Use software serial
  2. Switch to a device with more than one hardware serial port
  3. Chose an alternate bit of hardware which uses SPI instead of UART

Usually, the SIM800 may be connected by software serial, and presumably may be connected to ESP8266 that way, thereby leaving TxD a,d RxD free for others. This presupposes ESP 8266 has pins for that purpose, but you don't say much about that module.

I thought RFM95 was a LoRa SPI device, and thus would not use Tx/Rx.

Functionality of RFM95 for radio comms could be replaced (assuming the thing at the other end can be reengineered also) with NRF24L01 module on the SPI interface.
Edit: scratch that. Nick is correct, Hope RFM95 is already an SPI device. Don’t connect that to the UART at all!

Looks like SIM800L can operate over either SPI or UART from the docs as well. Although I’ve never used one. So reconfigure that to use SPI.

That just leaves you with ESP8266 on your single UART port.

"With multiple Tx connecting to one Rx on the Arduino you are going to case a short. Don't do that! "

Can you explain that? Just curious. Diodes can be used to prevent possible multiple tx lines back feeding into an rx line.

zoomkat:
"With multiple Tx connecting to one Rx on the Arduino you are going to case a short. Don't do that! "

Can you explain that? Just curious. Diodes can be used to prevent possible multiple tx lines back feeding into an rx line.

Yes, don’t do that without some external hardware....
And assuming that devices don’t talk at the same time and garble each other.

And TBH I’m also hesitant to recommend workarounds for solutions the OP should only be attempting as a very last resort.