PIC24HJ32GP202 MICROCHIP [Microchip Technology], PIC24HJ32GP202 Datasheet - Page 154

no-image

PIC24HJ32GP202

Manufacturer Part Number
PIC24HJ32GP202
Description
High-Performance, 16-bit Microcontrollers
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
PIC24HJ32GP202/204 and PIC24HJ16GP304
16.1
The UART module includes a dedicated 16-bit Baud
Rate Generator (BRG). The BRGx register controls the
period of a free-running 16-bit timer. Equation 16-1
shows the formula for computation of the baud rate
with BRGH = 0.
EQUATION 16-1:
Example 16-1 shows the calculation of the baud rate
error for the following conditions:
• F
• Desired Baud Rate = 9600
EXAMPLE 16-1:
DS70289A-page 152
Desired Baud Rate
Solving for BRGx Value:
Calculated Baud Rate
Note:
CY
= 4 MHz
UART Baud Rate Generator
F
frequency (F
CY
Baud Rate =
BRGx =
BRGx
BRGx
BRGx
Error
denotes the instruction cycle clock
16 • Baud Rate
UART BAUD RATE WITH
BRGH = 0
BAUD RATE ERROR CALCULATION (BRGH = 0)
OSC
=
=
=
=
=
=
=
=
=
16 • (BRGx + 1)
F
/2
CY
F
((F
((4000000/9600)/16) – 1
25
4000000/(16 (25 + 1))
9615
(Calculated Baud Rate – Desired Baud Rate)
(9615 – 9600)/9600
0.16%
).
CY
CY
F
/(16 (BRGx + 1))
CY
/Desired Baud Rate)/16) – 1
– 1
Desired Baud Rate
Preliminary
The maximum baud rate (BRGH = 0) possible is
F
possible is F
Equation 16-2 shows the formula for computation of
the baud rate with BRGH = 1.
EQUATION 16-2:
The maximum baud rate (BRGH = 1) possible is F
(for BRGx = 0), and the minimum baud rate possible is
F
Writing a new value to the BRGx register causes the
BRG timer to be reset (cleared). This ensures the BRG
does not wait for a timer overflow before generating the
new baud rate.
CY
CY
Note:
/16 (for BRGx = 0), and the minimum baud rate
/(4 * 65536).
F
frequency (F
CY
CY
Baud Rate =
BRGx =
/(16 * 65536).
denotes the instruction cycle clock
UART BAUD RATE WITH
BRGH =
4 • Baud Rate
© 2007 Microchip Technology Inc.
OSC
4 • (BRGx + 1)
F
/2).
CY
F
1
CY
– 1
CY
/4

Related parts for PIC24HJ32GP202