25.3.2.4.1 Receiver Error Flags

The USART receiver features error detection mechanisms that uncover any corruption of the transmission. These mechanisms include the following:
  • Frame Error detection - controls whether the received frame is valid
  • Buffer Overflow detection - indicates data loss due to the receiver buffer being full and overwritten by the new data
  • Parity Error detection - checks the validity of the incoming frame by calculating its parity and comparing it to the Parity bit
Each error detection mechanism controls one error flag that can be read in the RXDATAH register:
  • Frame Error (FERR)
  • Buffer Overflow (BUFOVF)
  • Parity Error (PERR)
The error flags are located in the RX buffer together with their corresponding frame. The same flags are also present in the Status (USARTn.STATUS) register, but the flags here are set if any of the incoming bytes have an error. To know exactly which frame contains the error the Receiver Data High Byte (USARTn.RXDATAH) must be read.