Paul Williamson
Member
On the Teensy 3.x, standard serial baud rates below 1200 baud are not supported by the hardware UARTs, as documented here. Existing software serial libraries have other limitations, as documented here. So, I have created a new software serial library called SlowSoftSerial. It is available now at https://github.com/MustBeArt/SlowSoftSerial.
It can handle simultaneous receive and transmit, on any two digital pins of a Teensy 3.x, at any arbitrary baud rate from 1 baud up to, typically, 9600 baud or higher, at any word size (5-8 bits) and parity setting. It has minimal impact on interrupt latency (comparable to AltSoftSerial).
It uses two of the four Periodic Interrupt Timers, via the IntervalTimer library. It should be usable anywhere the IntervalTimer library works and pin change interrupts are available, but has only been tested on Teensy 3.5 so far. Currently only one SlowSoftSerial port at a time can be active, though you can have multiple ports defined and switch between them cleanly.
Like other software serial implementations, SlowSoftSerial can be sensitive to interrupt usage by other libraries. At any given baud rate, it is more sensitive than AltSoftSerial, but this is less of a problem at low baud rates.
In one typical use case, a SlowSoftSerial port can be defined to use the same transmit and receive pins as one of the hardware UARTs. If the requested baud rate is 1200 or higher, the application would use the hardware serial port. If the requested baud rate is lower than 1200, the application would use the SlowSoftSerial port instead. The switch can be completely transparent to the user and to the hardware design.
This is a newly written library, so it has not yet been battle-proven. Bug reports, comments, questions, and suggestions are welcome!
-Paul Williamson, paul@mustbeart.com
It can handle simultaneous receive and transmit, on any two digital pins of a Teensy 3.x, at any arbitrary baud rate from 1 baud up to, typically, 9600 baud or higher, at any word size (5-8 bits) and parity setting. It has minimal impact on interrupt latency (comparable to AltSoftSerial).
It uses two of the four Periodic Interrupt Timers, via the IntervalTimer library. It should be usable anywhere the IntervalTimer library works and pin change interrupts are available, but has only been tested on Teensy 3.5 so far. Currently only one SlowSoftSerial port at a time can be active, though you can have multiple ports defined and switch between them cleanly.
Like other software serial implementations, SlowSoftSerial can be sensitive to interrupt usage by other libraries. At any given baud rate, it is more sensitive than AltSoftSerial, but this is less of a problem at low baud rates.
In one typical use case, a SlowSoftSerial port can be defined to use the same transmit and receive pins as one of the hardware UARTs. If the requested baud rate is 1200 or higher, the application would use the hardware serial port. If the requested baud rate is lower than 1200, the application would use the SlowSoftSerial port instead. The switch can be completely transparent to the user and to the hardware design.
This is a newly written library, so it has not yet been battle-proven. Bug reports, comments, questions, and suggestions are welcome!
-Paul Williamson, paul@mustbeart.com