Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: SlowSoftSerial library for slow baud rates

  1. #1

    SlowSoftSerial library for slow baud rates

    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

    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,

  2. #2
    Paul - very nice bit of code. This will be VERY useful to those who do Model 28 or 30 TTY interfaces. The 110 baud they ran at was not easy to get without some tricky bit-banging. �� ��

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    I've added a link to the AltSoftSerial readme file.

    Hopefully that will help people find this if they need low baud rates.

  4. #4
    Thanks, Paul!

    The two web pages I linked above might be other places that could benefit from a link.


  5. #5
    SlowSoftSerial has now been tested with Teensy 4.0 and works there with no changes.

  6. #6
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    For the fun of it, I was curious about how slow I can get the FlexIO Serial code I have to run on T4...

    Not near slow enough...

    Unless I am missing something I believe the slowest clock I can bring to FLEXIO is 396mhz.
    The biggest dividers I can use are 8*8 or 64.
    So the actual clock to FlexIO would be: 6187500
    Now clock register counter mode for this only uses the lower Byte for counter so max 255 (counts+1) or 256 and multiplyed by 2:
    so I think the slowest I can go would be 6187500/(512) = 12084..

  7. #7
    Junior Member
    Join Date
    May 2020
    @Paul Williamson
    I noticed the "#define SSS_SERIAL_STOP_BIT_1_5 (0x20ul)" declaration in the header file, but it's not used anywhere.
    Is this still under test/development?
    I'm soon starting the restoration of a Lorenz Lo15 (German Lorenz build Teletype M15 on license) I'm not sure I need it. I think it could be 50 Baud 5bit no parity.
    Will be fun finding out when I get to that stage

  8. #8
    I didn't have any plans to implement the 1.5 stop bit mode, but I can look into doing so. It won't be a perfectly clean drop-in for the existing implementation, but it shouldn't be too hard to find a way to fit it in.

    If you only need one direction at a time, you can probably get by with the existing SlowSoftSerial feature set. Just send 2 stop bits (thus incurring a small extra delay between characters) or receive with 1 stop bit (allowing the "extra" 0.5 stop bit to be discarded harmlessly as inter-character delay). You can switch between the two modes as illustrated in one of the examples. But you can't do both simultaneously, so this isn't a complete workaround.

    Watch the SlowSoftSerial repo for news. Thanks for your interest!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts