
NUC126
Aug. 08, 2018
Page
877
of 943
Rev 1.03
NUC12
6 S
E
RI
E
S
T
E
CH
NI
CA
L R
E
F
E
RE
NCE
MA
NUA
L
3.
Select LIN function mode by setting FUNCSEL (UART_FUNCSEL[1:0]) to ‘01’.
4. Enable LIN slave mode by setting the SLVEN (UART_LINCTL[0]) to 1.
LIN header reception
According to the LIN protocol, a slave node must wait for a valid header which comes from the master
node. Next the slave task will take one of following actions (depending on the master header frame ID
value).
Receive the response.
Transmit the response.
Ignore the response and wait for next header.
In LIN Slave mode, user can enable the slave header detection function by setting the SLVHDEN
(UART_LINCTL[1]) to detect com
plete frame header (receive “break field”, “sync field” and “frame ID
field”). When a LIN header is received, the SLVHDETF (UART_LINSTS[0]) flag will be set. If the
LINIEN (UART_INTEN[8]) bit is set to 1, an interrupt will be generated. User can enable the frame ID
parity check function by setting IDPEN (UART_LINCTL[9]). If only received frame ID parity is not
correct (break and sync filed are correct), the SLVIDPEF (UART_LINSTS[2]) flag is set to ‘1’. If the
LINIEN(UART_INTEN[8]) is set to 1, an interrupt will be generated and SLVHDETF (
UART_LINSTS[0]) is set to ‘1’. User can also put LIN in mute mode by setting MUTE
(UART_LINCTL[4]) to ‘1’. This mode allows detection of headers only (break + sync + frame ID) and
prevents the reception of any other characters. In order to avoid bit rate tolerance, the controller
supports automatic resynchronization function to avoid clock deviation error, user can enable this
feature by setting SLVAREN (UART_LINCTL[2]).
LIN Response Transmission
The LIN slave node can transmit response and receive response. When slave node is the publisher of
the response, the slave node sends response by filling data to the UART_DAT register. If the slave
node is the subscriber of the response, the slave node receives data from LIN bus.
LIN Header Time-out Error
The LIN slave controller contains a header time-out counter. If the entire header is not received within
the maximum time limit of 57 bit times, the header error flag SLVHEF (UART_LINSTS [1]) will be set.
The time-out counter is enabled at each break detect edge and stopped in the following conditions.
A LIN frame ID field has been received.
The header error flag asserts.
Writing 1 to the SLVSYNCF (UART_LINSTS[3]) to re-search a new frame header.
Mute Mode and LIN Exit from Mute Mode Condition
In Mute mode, a LIN slave node will not receive any data until specified condition occurred. It allows
header detection only and prevents the reception of any other characters. User can enable Mute mode
by setting the MUTE (UART_LINCTL[4]) and exiting from Mute mode condition can be selected by
HSEL (UART_LINCTL[23:22]).
Note:
It is recommended to set LIN slave node to Mute mode after checksum transmission.
The LIN slave controller exiting from Mute mode is described as follows. If HSEL
(UART_LINCTL[23:
22]) is set to “break field”, when LIN slave controller detects a valid LIN break +
delimiter, the controller will enable the receiver (exit from Mute mode) and subsequent data (sync data,
frame ID data, response data) are received in RX FIFO.
If
HSEL (UART_LINCTL[23:22]) is set to “break field and sync field”, when the LIN slave controller
detects a valid LIN break + delimiter followed by a valid sync field without frame error, the controller
will enable the receiver (exit from mute mode) and subsequent data(ID data, response data) are
received in RX FIFO.
If HSEL (UART_LINCTL[23:22]) is set to “break field, sync field and ID field”,
when the LIN slave controller detects a valid LIN break + delimiter and valid sync field without frame
error followed by ID data without frame error and received ID data matched PID