25.3.4.2 Auto-Baud

The auto-baud feature lets allows the USART to autonomously configure its BAUD register based on input from a communication device, which enables the communication with multiple devices operating at different baud rates or compensate for any baud rate drift. The USART peripheral features two auto-baud modes: Generic Auto-Baud mode and LIN Constrained Auto-Baud mode.

Both auto-baud modes use an auto-baud frame to synchronize the BAUD registers, as illustrated in the figure below.

Figure 25-12. Auto-Baud Timing

The break field is detected when 11 or more consecutive low cycles are sampled, signaling to the USART that a synchronization field will follow. After the break field, when the Start bit of the synchronization field is detected, a counter running at the peripheral clock speed is started. The counter is then incremented for the next eight Tbit of the synchronization field. Once all eight bits are sampled, the counter is stopped. The resulting counter value is in effect the new BAUD register value.

When the Frame Format (FORM) bit field in the Control C (USARTn.CTRLC) register is set to auto-baud mode (AUTOBAUD), the Generic Auto-Baud mode is enabled. In this mode, the Wait For Break (WFBRK) bit in the Command (USARTn.COMMAND) register can optionally be set to allow detection of a break field of any length, including those shorter than 12 cycles. This makes it possible to set an arbitrary new baud rate without knowing the current baud rate. If the measured sync field results in a valid BAUD value (0x0064 - 0xFFFF), the BAUD register is updated.