Atmel Evaluation Kit AT91SAM9G25-EK AT91SAM9G25-EK Data Sheet

Product codes
AT91SAM9G25-EK
Page of 1102
816
SAM9G25 [DATASHEET]
11032C–ATARM–25-Jan-13
Figure 39-47.Master Node Configuration, NACT=IGNORE
Slave Node Configuration
z
Write TXEN and RXEN in US_CR to enable both the transmitter and the receiver.
z
Write USART_MODE in US_MR to select the LIN mode and the Slave Node configuration.
z
Write CD and FP in US_BRGR to configure the baud rate.
z
Wait until LINID in US_CSR rises
z
Check LINISFE and LINPE errors
z
Read IDCHR in US_RHR
z
Write NACT, PARDIS, CHKDIS, CHKTYPE, DLCM and DLC in US_LINMR to configure the frame transfer.
IMPORTANT: If the NACT configuration for this frame is PUBLISH, the US_LINMR register, must be write with NACT =
PUBLISH even if this field is already correctly configured, in order to set the TXREADY flag and the corresponding write
transfer request.
What comes next depends on the NACT configuration:
z
Case 1: NACT = PUBLISH, the LIN controller sends the response
z
Wait until TXRDY in US_CSR rises
z
Write TCHR in US_THR to send a byte
z
If all the data have not been written, redo the two previous steps
z
Wait until LINTC in US_CSR rises
z
Check the LIN errors
z
Case 2: NACT = SUBSCRIBE, the USART receives the response
z
Wait until RXRDY in US_CSR rises
z
Read RCHR in US_RHR
z
If all the data have not been read, redo the two previous steps 
z
Wait until LINTC in US_CSR rises
z
Check the LIN errors
z
Case 3: NACT = IGNORE, the USART is not concerned by the response
z
Wait until LINTC in US_CSR rises
z
Check the LIN errors
TXRDY
Write
US_LINIR
RXRDY
LINTC
Break
Synch
Protected
Identifier
Data 1
Data N
Checksum
Data N-1
Header
Inter-
frame
space
Response
space
Frame
Frame slot = TFrame_Maximum
Response
Data3
FSDIS=1
FSDIS=0