45.6.9.15.1 Host Node Configuration

  • Write TXEN and RXEN in US_CR to enable both the transmitter and the receiver.
  • Write USART_MODE in US_MR to select the LIN mode and the Host node configuration.
  • Write CD and FP in US_BRGR to configure the baud rate.
  • Write NACT, PARDIS, CHKDIS, CHKTYPE, DLCM, FSDIS and DLC in US_LINMR to configure the frame transfer.
  • Check that TXRDY in US_CSR is set to 1.
  • Write IDCHR in US_LINIR to send the header.

What comes next depends on the NACT configuration:

  • Case 1: NACT = PUBLISH, the USART sends the response
    • Wait until TXRDY in US_CSR rises.
    • Write TCHR in US_THR to send a byte.
    • If all the data have not been written, redo the two previous steps.
    • Wait until LINTC in US_CSR rises.
    • Check the LIN errors.
  • Case 2: NACT = SUBSCRIBE, the USART receives the response
    • Wait until RXRDY in US_CSR rises.
    • Read RCHR in US_RHR.
    • If all the data have not been read, redo the two previous steps.
    • Wait until LINTC in US_CSR rises.
    • Check the LIN errors.
  • Case 3: NACT = IGNORE, the USART is not concerned by the response.
    • Wait until LINTC in US_CSR rises.
    • Check the LIN errors.
      Figure 45-45. Host Node Configuration, NACT = PUBLISH
      Figure 45-46. Host Node Configuration, NACT = SUBSCRIBE
      Figure 45-47. Host Node Configuration, NACT = IGNORE