Datasheet

614
32117D–AVR-01/12
AT32UC3C
25.6.11 LIN Frame Handling
25.6.11.1 Master Node Configuration
Write TXEN and RXEN in CR to enable both the transmitter and the receiver.
Write MODE in MR to select the LIN mode and the Master Node configuration.
Write CD and FP in BRGR to configure the baud rate.
Write NACT, PARDIS, CHKDIS, CHKTYPE, DLCM, FSDIS and DLC in LINMR to configure
the frame transfer.
Check that TXRDY in CSR is set to “1”
Write IDCHR in 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 CSR rises
Write TCHR in THR to send a byte
If all the data have not been written, redo the two previous steps
Wait until LINTC in CSR rises
Check the LIN errors
Case 2: NACT = SUBSCRIBE, the USART receives the response
Wait until RXRDY in CSR rises
Read RCHR in RHR
If all the data have not been read, redo the two previous steps
Wait until LINTC in CSR rises
Check the LIN errors
Case 3: NACT = IGNORE, the USART is not concerned by the response
Wait until LINTC in CSR rises
Check the LIN errors