![Nuvoton NuMicro NUC029 Series Скачать руководство пользователя страница 352](http://html1.mh-extra.com/html/nuvoton/numicro-nuc029-series/numicro-nuc029-series_technical-reference-manual_1720306352.webp)
NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
352
of
497
Rev 1.00
N
U
MICRO
®
N
UC02
9L
E
E
/N
UC029
S
E
E
T
E
CHN
ICA
L R
E
F
E
R
E
NC
E
M
A
NU
A
L
Figure 6.13-13 LIN Frame ID and Parity Format
6.13.5.8.4
LIN Slave Mode
The UART0/UART1 controller supports LIN Slave mode. To enable and initialize the LIN Slave
mode, the following steps are necessary:
1. Setting the UA_BAUD register to select the desired baud rate.
2. Configure the data length to 8 bits by setting WLS (UA_LCR[1:0]) to
‘11’ and disable parity
check by clearing PBE (UA_LCR[3]) bit and configure with one stop bit by clearing NSB
(UA_LCR[2]) bit.
3. Select LIN function mode by setting FUN_SEL (UA_FUN_SEL[1:0]) to
“01”.
4. Enable LIN slave mode by setting the LINS_EN (UA_LIN_CTL[0]) to 1.
LIN header reception
According to the LIN protocol, a slave node must wait for a valid header which cames from the
master node. Next the slave task will take one of following actions (depend 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
LINS_HDET_EN (UA_LIN_CTL[10])
to detect complete frame header (receive “break field”, “sync
field” and “frame ID field”). When a LIN header is received, the LINS_HDET_F (UA_LIN_SR[0])
flag will be set. If the LIN_IEN (UA_IER[8]) bit is set to 1, an interrupt will be generated. User can
enable the frame ID parity check function by setting LIN_IDPEN (UA_LIN_CTL[9]). If only
received frame ID parity is not correct (break and sync filed are correct), the LIN_IDPERR_F
(UA_LIN_SR[2]) flag is set to
‘1’. If the LIN_IEN(UA_IER[8]) is set to 1, an interrupt will be
generated and LINS_HDET_F ( UA_LIN_SR[0]) is set to
‘1’. User can also put LIN in mute mode
by setting LIN_MUTE_EN (UA_LIN_CTL[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 LINS_ARS_EN (UA_LIN_CTL[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 UA_THR register.
If the slave node is the subscriber of the response, the slave node receives data from LIN bus.