English
Language : 

CP3BT10 Datasheet, PDF (122/210 Pages) National Semiconductor (TI) – Reprogrammable Connectivity Processor with Bluetooth and USB Interfaces
19.4 BAUD RATE CALCULATIONS
The UART baud rate is determined by the System Clock fre-
quency and the values in the UOVR, UPSR, and UBAUD
registers. Unless the System Clock is an exact multiple of
the baud rate, there will be a small amount of error in the re-
sulting baud rate. The equation to calculate the baud rate is:
BR = (-S--O--Y----×-S----N_----C-×---L--P--K---)
The N × P term is then divided by each Prescaler Factor
from Table 44 to obtain a value closest to an integer. The
factor for this example is 6.5.
N = 3----2---.--5---5---2-- = 5.008 (N = 5)
6.5
The baud rate register is programmed with a baud rate divi-
sor of 4 (N = baud rate divisor + 1). This produces a baud
clock of:
where BR is the baud rate, SYS_CLK is the System Clock,
O is the oversample rate, N is the baud rate divisor + 1, and
P is the prescaler divisor selected by the UPSR register.
Assuming a System Clock of 5 MHz, a desired baud rate of
9600, and an oversample rate of 16, the N × P term accord-
ing to the equation above is:
N × P = (---1---(6--5---×-×---1-9--0-6--6--0-)--0----) = 32.552
BR = --------(---5---×----1---0---6---)-------- = 9615.385
(16 × 5 × 6.5)
%error = (---9---6----1---5---.--3---8----5----–-----9---6----0---0----) = 0.16
9600
Note that the percent error is much lower than would be pos-
sible without the non-integer prescaler factor. Error greater
than 3% is marginal and may result in unreliable operation.
Refer to Table 46 below for more examples.
Table 46 Baud Rate Programming
Baud
Rate
300
600
1200
1800
2000
2400
3600
4800
7200
9600
14400
19200
38400
56000
115200
128000
230400
345600
460800
576000
691200
806400
921600
1105920
1382400
1536000
SYS_CLK = 48 MHz SYS_CLK = 24 MHz SYS_CLK = 12 MHz SYS_CLK = 10 MHz
O N P %err O N P %err O N P %err O N P %err
16 2000 5.0 0.00 16 2000 2.5 0.00 16 1250 2.0 0.00 13 1282 2.0 0.00
16 2000 2.5 0.00 16 1250 2.0 0.00 16 1250 1.0 0.00 13 1282 1.0 0.00
16 1250 2.0 0.00 16 1250 1.0 0.00 16 625 1.0 0.00 13 641 1.0 0.00
7 401 9.5 0.00 8 1111 1.5 0.01 12 101 5.5 0.01 12 463 1.0 0.01
16 1500 1.0 0.00 16 750 1.0 0.00 16 250 1.5 0.00 16 125 2.5 0.00
16 1250 1.0 0.00 16 625 1.0 0.00 16 125 2.5 0.00 9 463 1.0 0.01
8 1111 1.5 0.01 12 101 5.5 0.01 11 202 1.5 0.01 11 101 2.5 0.01
16 625 1.0 0.00 16 125 2.5 0.00 10 250 1.0 0.00 7 119 2.5 0.04
12 101 5.5 0.01 11 303 1.0 0.01 11 101 1.5 0.01 10 139 1.0 0.08
16 125 2.5 0.00 10 250 1.0 0.00 10 125 1.0 0.00 7 149 1.0 0.13
11 202 1.5 0.01 11 101 1.5 0.01 14 17 3.5 0.04 14 33 1.5 0.21
10 250 1.0 0.00 10 125 1.0 0.00 10 25 2.5 0.00 16 13 2.5 0.16
10 125 1.0 0.00 10 25 2.5 0.00 16 13 1.5 0.16 8 13 2.5 0.16
7 49 2.5 0.04 13 33 1.0 0.10 13 11 1.5 0.10 7 17 1.5 0.04
7 17 3.5 0.04 13 16 1.0 0.16 13 8 1.0 0.16 7 5 2.5 0.79
15 25 1.0 0.00 15 5 2.5 0.00 11 1 8.5 0.27 12 1 6.5 0.16
13 16 1.0 0.16 13 8 1.0 0.16 13 4 1.0 0.16 11 4 1.0 1.36
9 1 15.5 0.44 10 7 1.0 0.79 10 1 3.5 0.79
13 8 1.0 0.16 13 4 1.0 0.16 13 2 1.0 0.16 11 2 1.0 1.36
8 7 1.5 0.79 12 1 3.5 0.79 14 1 1.5 0.79 7 1 2.5 0.79
10 7 1.0 0.79 10 1 3.5 0.79 7 1 2.5 0.79
7 1 8.5 0.04 15 2 1.0 0.79 10 1 1.5 0.79
13 4 1.0 0.16 13 2 1.0 0.16 13 1 1.0 0.16
11 4 1.0 1.36 11 2 1.0 1.36
9 1 1.0 0.47
10 1 3.5 0.79 7 1 2.5 0.79
9 1 3.5 0.79 8 2 1.0 2.34
www.national.com
122