pico-feedback icon indicating copy to clipboard operation
pico-feedback copied to clipboard

HW feature request: UART Transmit Complete interrupt

Open esky-software opened this issue 3 years ago • 1 comments

It's often necessary to detect when the last byte of a transmission has fully completed - that is, when the tx shift register is empty (and stop bits have been transmitted) and there's nothing in the tx FIFO to start a new byte transmission.

This would appear to correspond to the BUSY flag in UARTFR transitioning to 0.

Generating a Transmit Complete interrupt on this transition would simplify detection and handling of this case.

esky-software avatar May 23 '22 09:05 esky-software

Tangentially related to the discussion in https://github.com/raspberrypi/pico-sdk/issues/548 particularly "The PL011 doesn't seem to have the necessary status bits for you to poll in order to wait for the current TX/RX characters to complete like it asks you to do. This code just adds a 15 baud period busy wait after disabling the UART, to make sure in-progress characters have finished."

The PL011 reference manual is here.

lurch avatar May 23 '22 09:05 lurch