DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

PIC16F720T-E/SO View Datasheet(PDF) - Microchip Technology

Part Name
Description
Manufacturer
PIC16F720T-E/SO
Microchip
Microchip Technology 
PIC16F720T-E/SO Datasheet PDF : 254 Pages
First Prev 121 122 123 124 125 126 127 128 129 130 Next Last
16.2 AUSART Baud Rate Generator
(BRG)
The Baud Rate Generator (BRG) is an 8-bit timer that
is dedicated to the support of both the asynchronous
and synchronous AUSART operation.
The SPBRG register determines the period of the free
running baud rate timer. In Asynchronous mode the
multiplier of the baud rate period is determined by the
BRGH bit of the TXSTA register. In Synchronous mode,
the BRGH bit is ignored.
Table 16-3 contains the formulas for determining the
baud rate. Example 16-1 provides a sample calculation
for determining the baud rate and baud rate error.
Typical baud rates and error values for various
asynchronous modes have been computed for your
convenience and are shown in Table 16-5. It may be
advantageous to use the high baud rate (BRGH = 1), to
reduce the baud rate error.
Writing a new value to the SPBRG register causes the
BRG timer to be reset (or cleared). This ensures that
the BRG does not wait for a timer overflow before
outputting the new baud rate.
PIC16(L)F720/721
EXAMPLE 16-1: CALCULATING BAUD
RATE ERROR
For a device with FOSC of 16 MHz, desired baud rate of
9600, and Asynchronous mode with SYNC = 0 and BRGH
= 0 (as seen in Table 16-5):
Desired Baud Rate = 6---4------S---P-F---B-O---R-S--G-C-----+------1----
Solving for SPBRG:
SPBRG
=
6----4------D----e---s--i--r-F-e---dO----BS---C-a---u---d----R----a---t--e---
1
=
6-1---46---0---09---06---00---00---0--
1
= 25.042= 25
Actual Baud Rate = 6--1-4--6---0-2--0-5--0---+0---0--1-0---
= 9615
%
Error
=
-A----c---t--u---a----l---B----a--D-u---de---s--Ri--r-a-e--t-d-e---B----a--D-u---ed---s--Ri--r-a-e--t-d-e---B----a---u---d----R----a---t--e--
100
=
9---6---1---95---6---0---09---6---0---0--
100
=
0.16%
TABLE 16-3: BAUD RATE FORMULAS
Configuration Bits
SYNC
BRGH
AUSART Mode
0
0
Asynchronous
0
1
Asynchronous
1
x
Synchronous
Legend: x = Don’t care, n = value of SPBRG register
Baud Rate Formula
FOSC/[64 (n+1)]
FOSC/[16 (n+1)]
FOSC/[4 (n+1)]
TABLE 16-4: REGISTERS ASSOCIATED WITH THE BAUD RATE GENERATOR
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
RCSTA
SPEN
RX9
SREN CREN ADDEN FERR OERR RX9D
126
SPBRG
BRG7 BRG6 BRG5 BRG4 BRG3 BRG2 BRG1 BRG0
127
TXSTA
CSRC
TX9
TXEN SYNC
BRGH TRMT TX9D
125
Legend: x = unknown, - = unimplemented read as ‘0’. Shaded cells are not used for the Baud Rate Generator.
2010-2013 Microchip Technology Inc.
DS41430D-page 127

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]