Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
499
/
631
of the baud rate register. Therefore, do not change the value of the baud rate register during communication.
Configure baud rates through LPUART_BRCFG1 and LPUART_BRRCFG2
For example, baud rate = 4800bps, clock frequency = 32768Hz.
LPUARTDIV = 32768/4800 = 6.82667.LPUART_BRCFG1 = 6 and the value of LPUART_BRCFG2 is calculated
by adding fractions in the table below (the value of LPUART_BRCFG2 is 0xEFh).
Decimal addition
Carry to the next integer
Bit field
Value
0.82667 + 0.82667 = 1.65333
YES
DECIMAL0
1
1.65333 + 0.82667 = 2.48000
YES
DECIMAL1
1
2.48000 + 0.82667 = 3.30667
YES
DECIMAL2
1
3.30667 + 0.82667 = 4.13333
YES
DECIMAL3
1
4.13333 + 0.82667 = 4.96000
NO
DECIMAL4
0
4.96000 + 0.82667 = 5.78667
YES
DECIMAL5
1
5.78667 + 0.82667 = 6.61333
YES
DECIMAL6
1
6.61333 + 0.82667 = 7.44000
YES
DECIMAL7
1
When LSE clock (32.768KHz) is used, the values of baud rate configuration registers LPUART_BRCFG1 and
LPUART_BRCFG2 with different baud rate Settings are as follows:
Baud rate
Divisor
LPUART_BRCFG1
LPUART_BRCFG2
300
109.2267
6Dh
88h
600
54.6133
36h
ADh
1200
27.3067
1Bh
24h
2400
13.6533
0Dh
6Dh
4800
6.8267
06h
EFh
9600
3.4133
03h
4Ah
Note: The lower the clock frequency of the CPU, the lower the accuracy of a particular baud rate.
If the MCU is powered by 3.3V, the LPUART baud rate should be within 1Mbps, and if the MCU is powered by 1.8V,
the LPUART baud rate should be within 115200bps.
Parity control
Reset the LPUART_CTRL.PCDIS bit, enable parity control (generate a parity bit when sending, parity check when
receiving), set or reset the LPUART_CTRL.PSEL bit selection to use odd or even check. LPUART frame formats