IT lexicon › Hardware › Idle line detection (UART)

Idle line detection (UART)

Hardware På svenska → Updated: 2026-11-04

A UART feature that fires when the receive line has been quiet for a full character time — the hardware's way of saying a message has ended.

DMA is excellent for receiving serial data without the CPU touching each byte, but DMA wants to know the length up front. A GPS module or an AT-command reply sends lines of unknown length. Idle line detection solves this: once the line has sat idle (high) for a whole frame after the last character, the UART sets a flag and can raise an interrupt. On STM32 it's called IDLE.

The resulting pattern is circular DMA into a ring buffer plus three interrupts — half-transfer, wrap-around and idle. In the handler you read how far the DMA counter has advanced and know exactly which bytes are new. The catch is that the idle window is only one character long: a sender that pauses mid-packet produces two half-messages. Newer parts therefore add a configurable receiver timeout as well.

← Back to the lexicon