English
Language : 

C8051F340 Datasheet, PDF (220/282 Pages) List of Unclassifed Manufacturers – Full Speed USB Flash MCU Family
C8051F340/1/2/3/4/5/6/7
19.1. Baud Rate Generator
The UART1 baud rate is generated by a dedicated 16-bit timer which runs from the controller’s core clock
(SYSCLK), and has prescaler options of 1, 4, 12, or 48. The timer and prescaler options combined allow
for a wide selection of baud rates over many SYSCLK frequencies.
The baud rate generator is configured using three registers: SBCON1, SBRLH1, and SBRLL1. The
UART1 Baud Rate Generator Control Register (SBCON1, SFR Definition 19.4) enables or disables the
baud rate generator, and selects the prescaler value for the timer. The baud rate generator must be
enabled for UART1 to function. Registers SBRLH1 and SBRLL1 contain a 16-bit reload value for the dedi-
cated 16-bit timer. The internal timer counts up from the reload value on every clock tick. On timer over-
flows (0xFFFF to 0x0000), the timer is reloaded. For reliable UART operation, it is recommended that the
UART baud rate is not configured for baud rates faster than SYSCLK/16. The baud rate for UART1 is
defined in Equation 19.1.
Baud Rate
=
(---6---5---5---3---6----–-----(--S-S--B-Y---R-S---L-C---H-L---1K---:--S---B----R----L----L----1---)--)
×
1--
2
× ----------1-----------
Prescaler
Equation 19.1. UART1 Baud Rate
A quick reference for typical baud rates and system clock frequencies is given in Table 19.1.
Table 19.1. Baud Rate Generator Settings for Standard Baud Rates
Target Baud Actual Baud Baud Rate
Rate (bps) Rate (bps)
Error
230400
115200
57600
28800
14400
9600
2400
1200
230400
115200
57600
28800
14400
9600
2400
1200
230400
115200
57600
28800
14400
9600
2400
1200
230769
115385
57692
28846
14388
9600
2400
1200
230769
115385
57692
28777
14406
9600
2400
1200
230769
115385
57554
28812
14397
9600
2400
1200
0.16%
0.16%
0.16%
0.16%
0.08%
0.0%
0.0%
0.0%
0.16%
0.16%
0.16%
0.08%
0.04%
0.0%
0.0%
0.0%
0.16%
0.16%
0.08%
0.04%
0.02%
0.0%
0.0%
0.0%
Oscillator
Divide
Factor
52
104
208
416
834
1250
5000
10000
104
208
416
834
1666
2500
10000
20000
208
416
834
1666
3334
5000
20000
40000
SB1PS[1:0]
(Prescaler Bits)
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
Reload Value in
SBRLH1:SBRLL1
0xFFE6
0xFFCC
0xFF98
0xFF30
0xFE5F
0xFD8F
0xF63C
0xEC78
0xFFCC
0xFF98
0xFF30
0xFE5F
0xFCBF
0xFB1E
0xEC78
0xD8F0
0xFF98
0xFF30
0xFE5F
0xFCBF
0xF97D
0xF63C
0xD8F0
0xB1E0
220
Rev. 0.5