Search topics...
UARTFlow Controlfoundational

Explain hardware flow control (RTS/CTS) and when it is necessary.

0 upvotes
Practice with AISoon
Study the fundamentals first — UART topic page

Hardware flow control adds two additional signals — RTS (Request to Send) and CTS (Clear to Send) — to prevent data loss when the receiver cannot keep up with the transmitter. The receiver asserts its RTS line to signal "I am ready to accept data." The transmitter checks the CTS line (connected to the receiver's RTS) before sending each byte; if CTS is de-asserted, the transmitter pauses until the receiver is ready again.

This is essential in two scenarios: (1) high baud rates where the receiver's ISR or DMA cannot drain the hardware FIFO fast enough, especially during bursts — for example, a Bluetooth module streaming data at 921600 baud into an MCU that occasionally disables interrupts for flash writes; (2) software processing delays where the receiver must parse, validate, or store data before it can accept more, and the processing time varies unpredictably.

The alternative is software flow control (XON/XOFF), where the receiver sends a special byte (0x13 = XOFF) to pause the transmitter and another (0x11 = XON) to resume. This uses no extra pins but is unreliable for binary data because the control bytes might appear in the data stream. It also adds latency — by the time the transmitter processes the XOFF, it may have already sent additional bytes. Hardware flow control reacts within one bit period and works with any data content, making it the preferred choice for reliable high-speed links.

Source: UART Q&A