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

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
24.3
DS31024A-page 24-6
Conversion Process
There are two methods for performing a conversion. To determine the end of conversion, the first
method uses the ADTMR overflow interrupt (OVFIF bit). The second method uses the A/D Cap-
ture Interrupt (ADCIF bit). At the end of conversion both bits are used to determine if an over-
range condition has occurred.
Method 1 uses a fixed conversion time, this means that the capacitor voltage always ramps to
the full scale voltage. Immediately after the overflow of the ADTMR, we recommend that the
ADRST bit is set to discharge the external capacitor. This will ensure that the residual voltage on
the external capacitor, due to dielectric absorption, is independent of input voltage or previous
conversions.
Method 2 uses a variable conversion time, which results in faster conversions for lower input volt-
ages.
Steps for Method 1 (“fixed conversion time”):
1.
2.
3.
4.
5.
6.
7.
8.
9.
10. Do Conversion Calculations
11. Goto Step 2
Initialize the Slope A/D module:
Set the ADRST bit (ADCON0<1>), until the ramp capacitor reaches ground. This is capac-
itor dependent. A minimum of 200 s is recommended.
Select Input Channel
Clear the OVFIF and ADCIF bits.
Initialize Slope A/D Timer (ADTMR). ADTMR value depends on bits of resolution required
(see
To start a conversion, clear the ADRST bit, this allows the ramp capacitor to begin charg-
ing and the ADTMR to increment.
Conversion is complete when the Slope A/D timer (ADTMR) overflows from FFFFh to
0000h. This causes the OVFIF bit to be set.
Check if the ADCIF bit is set. If this bit is set, the value in the capture register ADCAP is
valid. This method depends on minimum latency to verify the capture interrupt flag bit after
the ADTMR overflows. If the ADCIF bit is cleared, then the input voltage was out of the
A/D input range.
Set the ADRST bit (ADCON0<1>) to stop ADTMR and discharge external capacitor
a)Clear the REFOFF bit (SLPCON<5>)
b)Clear the ADOFF bit (SLPCON<0>)
c)Initialize ADCON1<7:4> to select the programmable current source.
Table
24-1).
1997 Microchip Technology Inc.

Related parts for PIC16F872-E/SS