20.4.2.2.2 LIN Responder Only Receive
The Responder is typically listening for a PID that it should respond to. Reception of a Break resets the checksum, parity calculation and contents of Parameter 3. The baud rate is automatically calculated and written to UxBRG. A Break after the auto-baud sequence starts will not be detected. Either not enough edges will be received and the BRG will overflow or the auto-baud sequence will complete on edges following the Break, resulting in a wrong baud rate value. The following procedure is used for Responder Only receive:
- Configure LIN Responder Only mode by writing ‘
0b1011
’ to the MODE[3:0] bits. - Set the ON and RXEN bits.
Upon reception of the Break, the RXBKIF flag is set. Upon reception of the PID, an RX interrupt is generated regardless of the RXWM[2:0] bits setting.
- The PID can be read from UxRXB. If a parity mismatch (P0 and P1) has occurred, the PERIF flag will be set.
- Write the number of bytes to receive to Parameter 3 (P3[7:0]).
- Configure the RX watermark interrupt setting using the RXWM[2:0] bits.
- Read data from UxRXB upon an interrupt event.
The UART automatically verifies the checksum. The checksum that the receiver calculates is stored in the RXCHK[7:0] bits (UxCHK[23:16]). If this value doesn’t match that of the received checksum, the CERIF flag (UxSTAT[4]) will be set, and if the CERIE (UxSTAT[12]) bit was set, an interrupt will be generated.