Hardware manual

Common Features Description
2-48 Atmel 8051 Microcontrollers Hardware Manual
4316A–8051–01/04
Figure 2-20. Internal Baud Rate
The baud rate for UART is token by formula:
Table 2-18. Example of computed value when X2=1, SMOD1=1, SPD=1
Example of computed value when X2=1, SMOD1=1, SPD=1
Table 2-19. Example of computed value when X2=0, SMOD1=0, SPD=0
Example of computed value when X2=0, SMOD1=0, SPD=0
The baud rate generator can be used for mode 1 or 3 (refer to Figure 2-22 on page 50),
but also for mode 0 for UART, thanks to the bit SRC located in BDRCON register (Table
2-29.)
BRG
0
1
/6
BRL
/2
0
1
INT_BRG
SPD
BRR
SMOD1
auto reload counter
overflow
Periph
Clock
F
PER
Baud Rates F
OSCA
= 16.384 MHz F
OSCA
= 24 MHz
BRL Error (%) BRL Error (%)
115200 247 1.23 243 0.16
57600 238 1.23 230 0.16
38400 229 1.23 217 0.16
28800 220 1.23 204 0.16
19200 203 0.63 178 0.16
9600 149 0.31 100 0.16
4800 43 1.23 - -
Baud Rates F
OSCA
= 16.384 MHz F
OSCA
= 24 MHz
BRL Error (%) BRL Error (%)
4800 247 1.23 243 0.16
2400 238 1.23 230 0.16
1200 220 1.23 204 0.16
600 185 0.16 152 0.16
B
aud_Rate =
2
SMOD1
x F
PER
6
(1-SPD)
x 32 x [256 - (BRL)]
(
BRL) = 256 -
2
SMOD1
x F
PER
6
(1-SPD)
x 32 x Baud_Rate