PIC16F872-E/SS Microchip Technology, PIC16F872-E/SS Datasheet - Page 212

no-image

PIC16F872-E/SS

Manufacturer Part Number
PIC16F872-E/SS
Description
IC,MICROCONTROLLER,8-BIT,PIC CPU,CMOS,SSOP,28PIN,PLASTIC
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F872-E/SS

Rohs Compliant
YES
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Connectivity
I²C, SPI
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
22
Program Memory Size
3.5KB (2K x 14)
Program Memory Type
FLASH
Eeprom Size
64 x 8
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 5.5 V
Data Converters
A/D 5x10b
Oscillator Type
External
Operating Temperature
-40°C ~ 125°C
Package / Case
28-SSOP
Package
28SSOP
Device Core
PIC
Family Name
PIC16
Maximum Speed
20 MHz
Operating Supply Voltage
5 V
Data Bus Width
8 Bit
Number Of Programmable I/os
22
Interface Type
I2C/SPI
On-chip Adc
5-chx10-bit
Number Of Timers
3
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
PICmicro MID-RANGE MCU FAMILY
14.5.2.2
DS31014A-page 14-10
Minimum Resolution
The minimum resolution (in time) of each bit of the PWM duty cycle depends on the prescaler of
Timer2.
Table 14-4: Minimum Duty Cycle Bit Time
Example 14-2:
At most, an 8-bit resolution duty cycle can be obtained from a 78.125 kHz frequency and a
20 MHz oscillator, i.e., 0 DCxB9:DCxB0 255. Any value greater than 255 will result in a 100%
duty cycle.
In order to achieve higher resolution, the PWM frequency must be decreased. In order to achieve
higher PWM frequency, the resolution must be decreased.
Table 14-5
caler and PR2 values are also shown.
Table 14-5: Example PWM Frequencies and Bit Resolutions at 20 MHz
Desired PWM frequency is 78.125 kHz,
Fosc = 20 MHz
TMR2 prescale = 1
Find the maximum resolution of the duty cycle that can be used with a 78.125 kHz frequency
and 20 MHz oscillator:
Timer Prescaler
(1, 4, 16)
PR2 Value
Maximum
Resolution (bits)
PWM Frequency
Prescaler
1/78.125 kHz= [(PR2) + 1] • 4 • 1/20 MHz • 1
12.8 s = [(PR2) + 1] • 4 • 50 ns • 1
PR2
1/78.125 kHz= 2
12.8 s = 2
256
log(256) = (PWM Resolution) • log(2)
8.0
Value
16
1
4
lists example PWM frequencies and resolutions for Fosc = 20 MHz. The TMR2 pres-
= 63
= 2
= PWM Resolution
PWM RESOLUTION
PWM RESOLUTION
PWM Period and Duty Cycle Calculation
T2CKPS1:T2CKPS0
PWM RESOLUTION
1.22 kHz
0xFF
16
10
0 0
0 1
1 x
• 50 ns • 1
4.88 kHz
• 1/20 MHz • 1
0xFF
10
4
19.53 kHz
Minimum Resolution
0xFF
10
1
(Time)
4 T
T
T
OSC
CY
CY
78.12 kHz
0x3F
1
8
1997 Microchip Technology Inc.
156.3 kHz
0x1F
1
7
208.3 kHz
0x17
5.5
1

Related parts for PIC16F872-E/SS