24.3.2.4.1 Receiver Error Flags

The USART receiver features error detection mechanisms that uncover 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 RXDATAH register that contains the error flags must be read before the RXDATAL register, since reading the RXDATAL register will trigger the RX buffer to shift out the RXDATA bytes.
Note: If the Character Size bit field (the CHSIZE bits in the USARTn.CTRLC register) is set to nine bits, low byte first (9BITL), the RXDATAH register will, instead of the RXDATAL register, trigger the RX buffer to shift out the RXDATA bytes. The RXDATAL register must, in that case, be read before the RXDATAH register.