beautypg.com

Baud rate generator, Atmega163(l) – Rainbow Electronics ATmega163L User Manual

Page 65

background image

ATmega163(L)

65

Baud Rate Generator

The baud rate generator is a frequency divider which generates baud-rates according to the following equation:

• BAUD = Baud-Rate

• f

CK

= Crystal Clock frequency

• UBR = Contents of the UBRRHI and UBRR registers, (0-4095)

• Note that this equation is not valid when the UART transmission speed is doubled. See “Double Speed Transmission” on

page 66 for a detailed description.

For standard crystal frequencies, the most commonly used baud rates can be generated by using the UBR settings in
Table 27. UBR values which yield an actual baud rate differing less than 2% from the target baud rate, are bold in the table.
However, using baud rates that have more than 1% error is not recommended. High error ratings give less noise
resistance.
Table 27. UBR Settings at Various Crystal Frequencies

BAUD

f

CK

16(UBR

1

)

+

---------------------------------

=

Baud Rate

1 MHz % Error

1,84 MHz %Error

2 MHz %Error

2,458 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,28 MHz % Error

3,69 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,37 MHz % Error

8 MHz %Error

2400

UBR=

191

0,0 UBR=

207

0,2

4800

UBR=

95

0,0 UBR=

103

0,2

9600

UBR=

47

0,0 UBR=

51

0,2

14400

UBR=

31

0,0 UBR=

34

0,8

19200

UBR=

23

0,0 UBR=

25

0,2

28800

UBR=

15

0,0 UBR=

16

2,1

38400

UBR=

11

0,0 UBR=

12

0,2

57600

UBR=

7

0,0 UBR=

8

3,7

76800

UBR=

5

0,0 UBR=

6

7,5

115200

UBR=

3

0,0 UBR=

3

7,8