SoftwareSerial limits

Using UNO RT3.
I've got a system that needs an HC12 and a BLE SoftwareSerial. That is in addition to an RTC and wind speed sensor.
Is it possible to use multiple Software serial ports? Or do I have a conflict in the io pins I'm using?

SoftwareSerial HC12(5, 4); // HC-12 TX, HC-12 RX
SoftwareSerial btSerial(3, 7); // RX, TX PIN

did you check the documentation ?

there is a paragraph stating

Limitations of This Library

SoftwareSerial library has the following known limitations:

  • It cannot transmit and receive data at the same time.
  • If using multiple software serial ports, only one can receive data at a time.
  • Not all pins on the Mega and Mega 2560 boards support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69). Not all pins on the Leonardo and Micro boards support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
  • On Arduino or Genuino 101 boards the current maximum RX speed is 57600bps.
  • On Arduino or Genuino 101 boards RX doesn't work on digital pin 13.

If your project requires simultaneous data flows, see Paul Stoffregen's AltSoftSerial library.

in practice you'll face challenges with too many ports esp. if they are quite busy. Use a MEGA (or MEGA mini clone which is about the size of your UNO (a bit smaller actually) ) and leverage the 4 hardware serial ports

4 Likes

And what is on hardware serial?

An ESP32 has it all.
Serial, built-in BT and local time/daylightsavings if you have internet near.
Leo..

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.