Am 25.08.25 um 15:54 schrieb Maarten Brock:
From: Martin Kaistra martin.kaistra@linutronix.de
Hello Martin,
Am 25.08.25 um 13:58 schrieb Maarten Brock:
Hello Martin,
Hi Maarten,
Why not just start the timer and check TEMT after it has elapsed and restart the timer if not empty? It would prevent busy-loop waiting.
It would, yes, but couldn't this cause the time between last transmitted byte and switching the RTS GPIO to be less than the specified RTS delay?
Maybe you can calculate the nominal duration of the transmission and add that to the delay? But yes, that could still result in a short delay.
You stated that the TEMT interrupt is not useable. Why not?
I see in my traces that it sometimes does not fire (even though it should be enabled and more than enough time has passed since the last byte).
But it does trigger the question what the RTS delay is used for?
- Is it to overcome the transmission of byte(s) still in the UART?
- Is it to overcome the transmission of the stop bit(s)?
- Can anyone imagine anything else that requires a delay?
- Is the given delay a minimum, typical or maximum value?
Maarten
Martin
Kind regards, Maarten Brock