beautypg.com

12 ubrr1l - usart1 baud rate register low byte, 11 examples of baud rate setting, Atmega128rfa1 – Rainbow Electronics ATmega128RFA1 User Manual

Page 365

background image

365


8266A-MCU Wireless-12/09

ATmega128RFA1

Bit 3:0 – UBRR11:8 - USART Baud Rate Register

These bits represent bits [11:8] of the Baud Rate Register. Sample values for
commonly used clock frequencies can be found in section "Examples of Baud Rate
Setting".

23.10.12 UBRR1L – USART1 Baud Rate Register Low Byte

Bit

7

6

5

4

3

2

1

0

NA ($CC)

UBRR7

UBRR6

UBRR5

UBRR4

UBRR3

UBRR2

UBRR1

UBRR0

UBRR1L

Read/Write

RW

RW

RW

RW

RW

RW

RW

RW

Initial Value

0

0

0

0

0

0

0

0

UBRR1 is a 12-bit register which contains the USART baud rate. The UBRR1H
contains the four most significant bits, and the UBRR1L 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 UBRR1L will trigger an
immediate update of the baud rate prescaler.

Bit 7:0 – UBRR7:0 - USART Baud Rate Register

These bits represent bits [7:0] of the Baud Rate Register. Sample values for commonly
used clock frequencies can be found in section "Examples of Baud Rate Setting".

23.11 Examples of Baud Rate Setting

For standard crystal and resonator frequencies, the most commonly used baud rates for
asynchronous operation can be generated by using the UBRR settings in

Table 23-14

below

to

Table 23-16 on page 367

. UBRR 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 resistance when the error
ratings are high, especially for large serial frames (see

"Asynchronous Operational

Range" on page 353

). The error values are calculated using the following equation:

[ ]

%

100

1

%



=

BaudRate

BaudRate

Error

Match

Closest

Table 23-14. Examples of UBRRn Settings for Commonly Used Oscillator Frequencies

f

OSC

= 1.8432 MHz

f

OSC

= 2.0000 MHz

f

OSC

= 3.6864 MHz

U2Xn = 0

U2Xn = 1

U2Xn = 0

U2Xn = 1

U2Xn = 0

U2Xn = 1

Baud
Rate
(bps)

UBRR

Error

UBRR

Error

UBRR

Error

UBRR

Error

UBRR

Error

UBRR

Error

2400

47

0.0%

95

0.0%

51

0.2%

103

0.2%

95

0.0%

191

0.0%

4800

23

0.0%

47

0.0%

25

0.2%

51

0.2%

47

0.0%

95

0.0%

9600

11

0.0%

23

0.0%

12

0.2%

25

0.2%

23

0.0%

47

0.0%

14.4k

7

0.0%

15

0.0%

8

-3.5%

16

2.1%

15

0.0%

31

0.0%

19.2k

5

0.0%

11

0.0%

6

-7.0%

12

0.2%

11

0.0%

23

0.0%

28.8k

3

0.0%

7

0.0%

3

8.5%

8

-3.5%

7

0.0%

15

0.0%

38.4k

2

0.0%

5

0.0%

2

8.5%

6

-7.0%

5

0.0%

11

0.0%