Hardware Managed TxEnable for RS485, on Teensy 4.0


New member
Hi All,

Is there any way to use Hardware Managed TxEnable on a Teensy 4.0? With the transmitterEnable(pin) lib function, I have a timing issue at a baud rate of 1Mbaud.
The built in HardwareSerial code doesn't use this hardware feature, because control of the pin is based only on the hardware FIFO without any awareness of the transmit buffer implemented by the HardwareSerial.cpp.
Attached library does Serial via DMA and lets you do RS485 with direction control.

View attachment DMA_UARTs.zip

Transmission is a bit more packet oriented. You first populate a buffer, then call trigger_tx () to start the actual transmission.
Wrote this for T41 specifically, but should work on T40 as well I'd expect (on the fewer ports that are available).