English
Language : 

ATMEGA48_10-07 Datasheet, PDF (193/378 Pages) ATMEL Corporation – 8-bit Microcontroller with 4/8/16K Bytes In-System Programmable Flash
ATmega48/88/168
Table 19-8.
UCPOLn
0
1
UCPOLn Bit Settings
Transmitted Data Changed (Output of
TxDn Pin)
Rising XCKn Edge
Falling XCKn Edge
Received Data Sampled (Input on RxDn
Pin)
Falling XCKn Edge
Rising XCKn Edge
19.10.5
UBRRnL and UBRRnH – USART Baud Rate Registers
Bit
Read/Write
Initial Value
15
14
13
12
11
–
–
–
–
UBRRn[7:0]
7
6
5
4
3
R
R
R
R
R/W
R/W
R/W
R/W
R/W
R/W
0
0
0
0
0
0
0
0
0
0
10
9
UBRRn[11:8]
2
1
R/W
R/W
R/W
R/W
0
0
0
0
8
UBRRnH
UBRRnL
0
R/W
R/W
0
0
• Bit 15:12 – Reserved Bits
These bits are reserved for future use. For compatibility with future devices, these bit must be
written to zero when UBRRnH is written.
• Bit 11:0 – UBRR11:0: USART Baud Rate Register
This is a 12-bit register which contains the USART baud rate. The UBRRnH contains the four
most significant bits, and the UBRRnL contains the eight least significant bits of the USART
baud rate. Ongoing transmissions by the Transmitter and Receiver will be corrupted if the baud
rate is changed. Writing UBRRnL will trigger an immediate update of the baud rate prescaler.
19.11 Examples of Baud Rate Setting
For standard crystal and resonator frequencies, the most commonly used baud rates for asyn-
chronous operation can be generated by using the UBRRn settings in Table 19-9. UBRRn
values which yield an actual baud rate differing less than 0.5% from the target baud rate, are
bold in the table. Higher error ratings are acceptable, but the Receiver will have less noise resis-
tance when the error ratings are high, especially for large serial frames (see “Asynchronous
Operational Range” on page 186). The error values are calculated using the following equation:
Error[%]
=
⎛
⎝
B----a---u---d---R----a---t-e---C----l-o--s--e--s--t--M-----a--t-c--h-
BaudRate
–
1⎠⎞
• 100%
2545S–AVR–07/10
193