
NUC126
Aug. 08, 2018
Page
863
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
the BR
COMP (UART_BRCOMP[8:0]) can be set as 9’b010000010 = 0x82.
6.23.5.3 UART Controller Auto-Baud Rate Function Mode
The Auto-Baud Rate function can measure baud rate of receiving data from UART RX pin
automatically. When the Auto-Baud Rate measurement is finished, the measuring baud rate is loaded
to BRD (UART_BAUD[15:0]). Both of the BAUDM1 (UART_BAUD[29]) and BAUDM0
(UART_BAUD[28]) are set to 1 automatically. UART RX data from Start bit to 1
st
rising edge time is set
by 2
ABRDBITS
bit time in Auto-Baud Rate function detection frame.
2
ABRDBITS
bit time from Start bit to the 1
st
rising edge is calculated by setting ABRDBITS
(UART_ALTCTL[20:19]). Setting ABRDEN (UART_ALTCTL[18]) is to enable auto-baud rate function.
In beginning stage, the UART RX is kept at 1. Once falling edge is detected, START bit is received.
The auto-baud rate counter is reset and starts counting. The auto-baud rate counter will be stop when
the 1
st
rising edge is detected. Then, auto-baud rate counter value divided by ABRDBITS
(UART_ALTCTL[20:19])
is
loaded
to
BRD
(UART_BAUD[15:0])
automatically.
ABRDEN
(UART_ALTCTL[18]) is cleared. Once the auto-baud rate measurement is finished, the ABRDIF
(UART_FIFOSTS[1])
is
set.
When
auto-baud
rate
counter
is
overflow,
ABRDTOIF
(UART_FIFOSTS[2]) is set. ABRDIF (UART_FIFOSTS[1]) or ABRDTOIF (UART_FIFOSTS[2]) cause
the auto-baud rate flag ABRIF(UART_ALTCTL[17]) is generated. If the ABRIEN (UART_INTEN[18]) is
enabled, ABRIF(UART_ALTCTL[17]) cause the auto-baud rate interrupt ABRINT (UART_INTSTS[31])
is generated.
start
bit 1
bit 2
bit 0
bit 3
bit 4
bit 5
bit 6
UART_RX
0 1 2 3
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
... ...
...
...
...
...
...
... ...
bit 7
parity
stop
Auto Baud
Rate Counter
m
m÷ 2
n
keep old BRD
n = 00
n = 01
n = 10
n = 11
ABRDIF
(UART_FIFOSTS[1])
BRD
(UART_BAUD[15:0])
ABRDEN
(UART_ALTCTL[18])
n = ABRDBITS (UART_ALTCTL[20:19])
Figure 6.23-3 Auto-Baud Rate Measurement
Programming Sequence Example:
1. Program ABRDBITS (UART_ALTCTL[20:19]) to determine UART RX data 1
st
rising edge time
from Start by 2
ABRDBITS
bit time.
2. Set ABRIEN (UART_INTEN[18]) to enable auto-baud rate function interrupt.
3. Set ABRDEN (UART_ALTCTL[18]) to enable auto-baud rate function.
4. After ABRDIF (UART_FIFOSTS[1]) is set, the auto-baud rate measurement is finished.
5. Operate UART transmit and receive action.
6. Set ABRDTOIF (UART_FIFOSTS[2]) if auto-baud rate counter is overflow.
7. Go to Step 3.