PIC17C42 Microchip Technology, PIC17C42 Datasheet - Page 86

no-image

PIC17C42

Manufacturer Part Number
PIC17C42
Description
High-Performance 8-Bit CMOS EPROM/ROM Microcontroller
Manufacturer
Microchip Technology
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC17C42-16/JW
Manufacturer:
AD
Quantity:
12
Part Number:
PIC17C42A-16/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16/PQ
Manufacturer:
MICROCH
Quantity:
20 000
Part Number:
PIC17C42A-16/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/L
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-16E/PQ
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC17C42A-25/P
Manufacturer:
MICROCLOCK
Quantity:
20 000
PIC17C4X
13.1
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. Table 13-1 shows
the formula for computation of the baud rate for differ-
ent USART modes. These only apply when the USART
is in synchronous master mode (internal clock) and
asynchronous mode.
Given the desired baud rate and Fosc, the nearest inte-
ger value between 0 and 255 can be calculated using
the formula below. The error in baud rate can then be
determined.
TABLE 13-1:
X = value in SPBRG (0 to 255)
TABLE 13-2:
DS30412C-page 86
Address
13h, Bank 0
15h, Bank 0
17h, Bank 0
Legend: x = unknown, u = unchanged, - = unimplemented read as a '0', shaded cells are not used by the Baud Rate Generator.
Note 1: Other (non power-up) resets include: external reset through MCLR and Watchdog Timer Reset.
SYNC
0
1
USART Baud Rate Generator (BRG)
Asynchronous
Synchronous
Name
RCSTA
TXSTA
SPBRG
Mode
BAUD RATE FORMULA
REGISTERS ASSOCIATED WITH BAUD RATE GENERATOR
Baud rate generator register
CSRC
SPEN
Bit 7
F
F
Bit 6
RX9
TX9
OSC
OSC
Baud Rate
/(64(X+1))
/(4(X+1))
SREN
TXEN
Bit 5
CREN
SYNC
Bit 4
Bit 3
Example 13-1 shows the calculation of the baud rate
error for the following conditions:
EXAMPLE 13-1: CALCULATING BAUD
Writing a new value to the SPBRG, 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.
Desired Baud rate=Fosc / (64 (X + 1))
Error =
FERR
Bit 2
F
Desired Baud Rate = 9600
SYNC = 0
9600 =
X
Calculated Baud Rate=16000000 / (64 (25 + 1))
=
=
=
OSC
OERR
TRMT
Bit 1
= 16 MHz
=
9615
(Calculated Baud Rate - Desired Baud Rate)
(9615 - 9600) / 9600
0.16%
16000000 /(64 (X + 1))
25.042 = 25
RATE ERROR
Desired Baud Rate
RX9D
TX9D
Bit 0
1996 Microchip Technology Inc.
0000 -00x
0000 --1x
xxxx xxxx
Power-on
Value on
Reset
other resets
Value on all
0000 -00u
0000 --1u
uuuu uuuu
(Note1)

Related parts for PIC17C42