Auto-Baud Detection

The UART module offers an automatic baud rate detection system when operating in 8-bit modes only. The Auto-Baud Detection system prevents data loss or corruption by measuring the incoming signal on the RX pin and updating the UxBRGH:UxBRGL register pair to match the incoming rate. The Auto-baud Detection Enable (ABDEN) bit of UxCON0 controls the automatic baud rate detection system.

It is important to note that the BRG is used to measure the period of the received character ā€˜Uā€™, or 0x55. This character is unique in the sense that it contains five alternating rising and falling edges. The auto-baud calibration sequence begins on the first falling edge of the character after the ABDEN bit is set. While the calibration sequence is active, the UART state machine is held in an Idle state, and the UxBRGH:UxBRGL register pair is clocked at 1/8th the base baud rate. The sequence ends on the 5th falling edge of the incoming character. At that point, the measured time value is loaded into the UxBRGH:UxBRGL register pair, the ABDEN bit is cleared, and the Auto-Baud Detect Interrupt Flag (ABDIF) is set.