Datasheet
1999-2013 Microchip Technology Inc. Preliminary DS41124D-page 79
PIC16C745/765
11.1 USART Baud Rate Generator (BRG)
The BRG supports both the Asynchronous and Syn-
chronous modes of the USART. It is a dedicated 8-bit
baud rate generator. The SPBRG register controls the
period of a free running 8-bit timer. In Asynchronous
mode, bit BRGH (TXSTA<2>) also controls the baud
rate. In Synchronous mode, bit BRGH is ignored.
Table 11-1 shows the formula for computation of the
baud rate for different USART modes which only apply
in Master mode (internal clock).
Given the desired baud rate and F
INT, the nearest inte-
ger value for the SPBRG register can be calculated
using the formula in Table 11-1. From this, the error in
baud rate can be determined.
It may be advantageous to use the high baud rate
(BRGH = 1) even for slower baud clocks. This is
because the F
INT/(16(X + 1)) equation can reduce the
baud rate error in some cases.
Writing a new value to the SPBRG register causes the
BRG timer to be reset (or cleared). This ensures the
BRG does not wait for a timer overflow before output-
ting the new baud rate.
11.1.1 SAMPLING
The data on the RC7/RX/DT pin is sampled three times
near the center of each bit time by a majority detect cir-
cuit to determine if a high or a low level is present at the
RX pin.
TABLE 11-1: BAUD RATE FORMULA
TABLE 11-2: BAUD RATES FOR
SYNCHRONOUS MODE
TABLE 11-3: BAUD RATES FOR
ASYNCHRONOUS MODE
(BRGH = 0)
SYNC BRGH = 0 (Low Speed) BRGH = 1 (High Speed)
0
1
(Asynchronous) Baud Rate = FINT/(64(SPBRG+1))
(Synchronous) Baud Rate = F
INT/(4(SPBRG+1))
Baud Rate = F
INT/(16(SPBRG+1))
NA
Desired
Baud
24 MHz
Actual
Baud
% of Error SPBRG
300
1200
2400
4800
9600
19200
38400 38461.54 0.16 155
57600 57692.31 0.16 103
115200 115384.62 0.16 51
230400 230769.23 0.16 25
460800 461538.46 0.16 12
921600 1000000.00 8.51 5
Desired
Baud
24 MHz
Actual
Baud
% of Error SPBRG
300
1200
2400 2403.85 0.16 155
4800 4807.69 0.16 77
9600 9615.38 0.16 38
19200 19736.84 2.80 18
38400 41666.67 8.51 8
57600 62500.00 8.51 5
115200 125000.00 8.51 2
230400
460800
921600