
NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
350
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
(UA_LIN_CTL [12]) to
“1”, if the input pin (UART_RX) state is not equal to the output pin
(UART_TX) state in LIN transmitter state that hardware will generate an interrupt to CPU.
Software can also monitor the LIN bus transfer state by checking the read back data in UA_RBR
register. The following sequence is a program sequence example.
The procedure without software error monitoring in Master mode:
1. Fill Protected Identifier to LIN_PID (UA_LIN_CTL[31:24]).
2. Select the hardware transmission header field including
“break field + sync field + protected
iden
tifier field” by setting LIN_HEAD_SEL (UA_LIN_CTL [23:22]) to 10
3. Setting LIN_SHD (UA_LIN_CTL[8]) bit to 1 for requesting header transmission.
4. Wait until LIN_SHD (UA_LIN_CTL[8]) bit cleared by hardware.
5. Wait until TE_FLAG (UA_FSR[28]) set to 1 by hardware.
Note1:
The default setting of break field is 12 dominant bits (break field) and 1 recessive bit
break/sync delimiter. Setting LIN_BKFL (UA_LIN_CTL [19:16]) and LIN_BS_LEN
(UA_LIN_CTL[21:20]) to change the LIN break field length and break/sync delimiter length.
Note2:
The default setting of break/sync delimiter length is 1-bit time and the inter-byte spaces
default setting is also 1-bit time. Setting LIN_BS_LEN (UA_LIN_CTL[21:20]) and
DLY(UA_TOR[7:0]) can change break/sync delimiter length and inter-byte spaces.
Note3:
If the header includes the
“break field, sync field and frame ID field”, software must fill
frame ID to LIN_PID (UA_LIN_CTL[31:24]) before trigger header transmission (setting the
LIN_SHD (UA_LIN_CTL[8]). The frame ID parity can be generated by software or hardware
depending on LIN_IDPEN (UA_LIN_CTL[9]) setting. If the parity generated by software with
LIN_IDPEN (UA_LIN_CTL[9]) is set to
‘0’, software must fill 8 bit data (include 2 bit parity) in this
field. If the parity generated by hardware with LIN_IDPEN (UA_LIN_CTL[9]) is set to
‘1’ , software
fill ID0~ID5 and hardware calculates P0 and P1.
Procedure with software error monitoring in Master mode:
1. Choose the hardware transmission header field only including
“break field” by setting
LIN_HEAD_SEL (UA_LIN_CTL [23:22])
] to ‘00’.
2. Enable break detection function by setting LIN_BKDET_EN (UA_LIN_CTL[10]).
3. Request break + break/sync delimiter transmission by setting the LIN_SHD
(UA_LIN_CTL[8])
4. Wait until the LIN_BKDET_F (UA_LIN_SR[8]) flag is set to
“1” by hardware..
5. Request sync field transmission by writing 0x55 into UA_THR register.
6. Wait until the RDA_IF (UA_ISR[0]) is set to
“1” by hardware and then read back the UA_RBR
register.
7. Request header frame ID transmission by writing the protected identifier value to UA_THR
register.
8. Wait until the RDA_IF (UA_ISR[0]) is set to
“1” by hardware and then read back the UA_RBR
register.
LIN break and delimiter detection