
233
XMEGA A [MANUAL]
8077I–AVR–11/2012
Figure 21-2. Clock generation logic, block diagram.
21.3.1 Internal Clock Generation - The Fractional Baud Rate Generator
The fractional baud rate generator is used for internal clock generation for asynchronous modes, synchronous master
mode, and master SPI mode operation. The output frequency generated (fBAUD) is determined by the period setting
(BSEL), an optional scale setting (BSCALE), and the peripheral clock frequency (fPER). Table 21-1 on page 233 contains equations for calculating the baud rate (in bits per second) and for calculating the BSEL value for each mode of
operation. It also shows the maximum baud rate versus peripheral clock frequency. BSEL can be set to any value
between 0 and 4095. BSCALE can be set to any value between -7 and +7, and increases or decreases the baud rate
slightly to provide the fractional baud rate scaling of the baud rate generator.
When BSEL is 0, BSCALE must also be 0. Also, the value 2ABS(BSCALE) must at most be one half of the minimum number
Table 21-1. Equations for calculating baud rate register settings.
Note:
1.
The baud rate is defined to be the transfer rate in bits per second (bps)
Baud Rate
Generator
/2
BSEL
/4
/2
Sync
Register
fOSC
XCK
Pin
txclk
CLK2X
UMSEL [1]
DDR_XCK
0
1
0
1
xcki
xcko
DDR_XCK
rxclk
0
1
0
Edge
Detector
PORT_INV
fBAUD
Operating mode
Conditions
BSEL value calculation
Asynchronous normal
speed mode (CLK2X = 0)
BSCALE ≥ 0
BSCALE < 0
Asynchronous double
speed mode (CLK2X = 1)
BSCALE ≥ 0
BSCALE < 0
Synchronous and master
SPI mode
f
BAUD
f
PER
16
-----------
f
BAUD
f
PER
2
BSCALE
16(
BSEL
1)
+
------------------------------------------------------------
=
BSEL
f
PER
2
BSCALE
16
f
BAUD
-----------------------------------------------
1
–
=
f
BAUD
f
PER
16
-----------
f
BAUD
f
PER
16((2
BSCALE
BSEL
1)
+
-----------------------------------------------------------------
=
BSEL
1
2
BSCALE
---------------------
f
PER
16f
BAUD
---------------------
1
–
=
f
BAUD
f
PER
8
-----------
f
BAUD
f
PER
2
BSCALE
8
BSEL
1
+
--------------------------------------------------------------
=
BSEL
f
PER
2
BSCALE
8
f
BAUD
--------------------------------------------
1
–
=
f
BAUD
f
PER
8
-----------
f
BAUD
f
PER
8((2
BSCALE
BSEL
1)
+
---------------------------------------------------------------
=
BSEL
1
2
BSCALE
---------------------
f
PER
8f
BAUD
------------------
1
–
=
f
BAUD
f
PER
2
-----------
f
BAUD
f
PER
2
BSEL
1
+
------------------------------------
=
BSEL
f
PER
2f
BAUD
------------------
1
–
=