75
ATmega161(L)
1228B–09/01
Baud Rate Generator
The baud rate generator is a frequency divider that generates baud rates according to
the following equation:
•
BAUD = Baud rate
•
f
CK
= Crystal clock frequency
•
UBR = Contents of the UBRRH and UBRR registers (0 - 4095)
•
Note that this equation is not valid when the UART transmission speed is doubled.
See “Double-speed Transmission” for a detailed description.
For standard crystal frequencies, the most commonly used baud rates can be generated
by using the UBR settings in Table 24. UBR values that yield an actual baud rate differ-
ing less than 2% from the target baud rate are boldface in the table. However, using
baud rates that have more than 1% error is not recommended. High error ratings give
less noise resistance.
Table 24.
UBR Settings at Various Crystal Frequencies
BAUD
f
CK
16(UBR
1
)
+
----------------------------------
=
Baud Rate
1 MHz
%Error
1.8432 MHz
%Error
2 MHz
%Error
2.4576 MHz
%Error
2400
UBR=
25
0.2
UBR=
47
0.0
UBR=
51
0.2
UBR=
63
0.0
4800
UBR=
12
0.2
UBR=
23
0.0
UBR=
25
0.2
UBR=
31
0.0
9600
UBR=
6
7.5 UBR=
11
0.0
UBR=
12
0.2
UBR=
15
0.0
14400
UBR=
3
7.8 UBR=
7
0.0
UBR=
8
3.7 UBR=
10
3.1
19200
UBR=
2
7.8 UBR=
5
0.0
UBR=
6
7.5 UBR=
7
0.0
28800
UBR=
1
7.8 UBR=
3
0.0
UBR=
3
7.8 UBR=
4
6.3
38400
UBR=
1
22.9 UBR=
2
0.0
UBR=
2
7.8 UBR=
3
0.0
57600
UBR=
0
7.8 UBR=
1
0.0
UBR=
1
7.8 UBR=
2
12.5
76800
UBR=
0
22.9 UBR=
1
33.3 UBR=
1
22.9 UBR=
1
0.0
115200
UBR=
0
84.3 UBR=
0
0.0
UBR=
0
7.8 UBR=
0
25.0
Baud Rate
3.2768 MHz
%Error
3.6864 MHz
%Error
4 MHz
%Error
4.608 MHz
%Error
2400
UBR=
84
0.4
UBR=
95
0.0
UBR=
103
0.2
UBR=
119
0.0
4800
UBR=
42
0.8
UBR=
47
0.0
UBR=
51
0.2
UBR=
59
0.0
9600
UBR=
20
1.6
UBR=
23
0.0
UBR=
25
0.2
UBR=
29
0.0
14400
UBR=
13
1.6
UBR=
15
0.0
UBR=
16
2.1 UBR=
19
0.0
19200
UBR=
10
3.1 UBR=
11
0.0
UBR=
12
0.2
UBR=
14
0.0
28800
UBR=
6
1.6
UBR=
7
0.0
UBR=
8
3.7 UBR=
9
0.0
38400
UBR=
4
6.3 UBR=
5
0.0
UBR=
6
7.5 UBR=
7
6.7
57600
UBR=
3
12.5 UBR=
3
0.0
UBR=
3
7.8 UBR=
4
0.0
76800
UBR=
2
12.5 UBR=
2
0.0
UBR=
2
7.8 UBR=
3
6.7
115200
UBR=
1
12.5 UBR=
1
0.0
UBR=
1
7.8 UBR=
2
20.0
Baud Rate
7.3728 MHz
%Error
8 MHz
%Error
9.216 MHz
%Error
11.059 MHz
%Error
2400
UBR=
191
0.0
UBR=
207
0.2
UBR=
239
0.0
UBR=
287
-
4800
UBR=
95
0.0
UBR=
103
0.2
UBR=
119
0.0
UBR=
143
0.0
9600
UBR=
47
0.0
UBR=
51
0.2
UBR=
59
0.0
UBR=
71
0.0
14400
UBR=
31
0.0
UBR=
34
0.8
UBR=
39
0.0
UBR=
47
0.0
19200
UBR=
23
0.0
UBR=
25
0.2
UBR=
29
0.0
UBR=
35
0.0
28800
UBR=
15
0.0
UBR=
16
2.1 UBR=
19
0.0
UBR=
23
0.0
38400
UBR=
11
0.0
UBR=
12
0.2
UBR=
14
0.0
UBR=
17
0.0
57600
UBR=
7
0.0
UBR=
8
3.7 UBR=
9
0.0
UBR=
11
0.0
76800
UBR=
5
0.0
UBR=
6
7.5 UBR=
7
6.7 UBR=
8
0.0
115200
UBR=
3
0.0
UBR=
3
7.8 UBR=
4
0.0
UBR=
5
0.0