
M0A21/M0A23 Series
May 06, 2022
Page
440
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
1. Select the desired baud rate by setting the UART_BAUD register.
2. Select LIN function mode by setting FUNCSEL (UART_FUNCSEL[2
:0]) to ‘001’.
3. Disable automatic resynchronization function by setting SLVAREN (UART_LINCTL[2]) is set
to 0.
4. Enable LIN slave mode by setting the SLVEN (UART_LINCTL[0]) is set to 1.
Slave Mode with Automatic Resynchronization (AR)
In Automatic Resynchronization (AR) mode, the controller will adjust the baud rate generator after each
sync field reception. The initialization process flow of Automatic Resynchronization mode is shown as
follows:
1. Select the desired baud rate by setting the UART_BAUD register.
2. Select LIN function mode by setting UART_FUNCSEL (UART_FUNCSEL[2
:0]) to ‘001’.
3. Enable automatic resynchr
onization function by setting SLVAREN (UART_LINCTL[2]) to ‘1’.
4. Enable LIN slave mode by setting the SLVEN (UART_LINCTL[0]) is set to
‘1’.
When the automatic resynchronization function is enabled, after each LIN break field, the time duration
between five falling edges is sampled on peripheral clock and the result of this measurement is stored
in an internal 13-bit register and the UART_BAUD register value will be automatically updated at the
end of the fifth falling edge. If the measure timer (13-bit) overflows before five falling edges, then the
header error flag SLVHEF (UART_LINSTS[1]) will be set.
start
bit0
bit1
bit2
bit3
bit4
bit5
bit6
bit7
stop
UART_BAUD
(m)
UART_BAUD
(n)
Measurement time
Break field
LIN Bus
UART_BAUD
Update baud rate if auto re-sync
function enable
Figure 6.11-21 LIN Sync Field Measurement
When operating in Automatic Resynchronization (AR) mode, software must select the desired baud rate
by setting the UART_BAUD register and hardware will store it at internal TEMP_REG register, after
each LIN break field, the time duration between five falling edges is sampled on peripheral clock and
the result of this measurement is stored in an internal 13-bit register BAUD_LIN and the result will be
updated to UART_BAUD register automatically.
To guarantee the transmission baud rate, the baud rate generator must reload the initial value before
each new break reception. The initial value is programmed by the application during initialization
(TEMP_REG). User can set SLVDUEN (UART_LINCTL[3]) to enable auto reload initial baud rate value
function. If the SLVDUEN (UART_LINCTL[3]) is set, when received the next character, hardware will
auto reload the initial value to UART_BAUD, and when the UART_BAUD be updated, the SLVDUEN
(UART_LINCTL[3]) will be cleared automatically. The behavior of LIN updated method as shown Figure
6.11-22.
Note1:
It is recommended to set the SLVDUEN bit before every checksum reception.
Note2:
When a header error is detected, user must write 1 to SLVSYNCF (UART_LINSTS[3]) to re-
search new frame header. When writing 1 to it, hardware will reload the initial baud rate TEMP_REG
and re-search new frame header.
Note3:
When operating in Automatic Resynchronization mode, the baud rate setting must be operated
at mode2 (BAUDM1 (UART_BAUD[29]) and BAUDM0 (UART_BAUD[28]) must be 1).