beautypg.com

The baud rate generator in double uart speed mode, Atmega161(l) – Rainbow Electronics ATmega161L User Manual

Page 79

background image

79

ATmega161(L)

1228C–AVR–08/02

The Baud Rate Generator in
Double UART Speed Mode

Note that the baud rate equation is different from the equation on page 76 when the
UART speed is doubled:

BAUD = Baud rate

f

CK

= Crystal Clock frequency

UBR = Contents of the UBRRHI and UBRR Registers (0 - 4095)

Note that this equation is only valid when the UART transmission speed is doubled.

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 1.5% from the target baud rate are boldface in the table. However, since
the number of samples are reduced and the system clock might have some variance
(this applies especially when using resonators), it is recommended that the baud rate
error be less than 0.5%.

BAUD

f

CK

8(UBR

1

)

+

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

=