PIC16F872-I/SP Microchip Technology Inc., PIC16F872-I/SP Datasheet - Page 83

no-image

PIC16F872-I/SP

Manufacturer Part Number
PIC16F872-I/SP
Description
28 PIN, 7 KB FLASH, 128 RAM, 22 I/O
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F872-I/SP

A/d Inputs
5-Channel, 10-Bit
Cpu Speed
5 MIPS
Eeprom Memory
64 Bytes
Input Output
22
Interface
I2C/SPI
Memory Type
Flash
Number Of Bits
8
Package Type
28-pin SPDIP
Programmable Memory
3.5K Bytes
Ram Size
128 Bytes
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F872-I/SP
Manufacturer:
PIC
Quantity:
270
Part Number:
PIC16F872-I/SP
Manufacturer:
PIC
Quantity:
270
Part Number:
PIC16F872-I/SP
Manufacturer:
SILICON
Quantity:
1 000
Part Number:
PIC16F872-I/SP
Manufacturer:
MIC
Quantity:
20 000
The ADRESH:ADRESL registers contain the 10-bit
result of the A/D conversion. When the A/D conversion
is complete, the result is loaded into this A/D result reg-
ister pair, the GO/DONE bit (ADCON0<2>) is cleared
and the A/D interrupt flag bit ADIF is set. The block dia-
gram of the A/D module is shown in Figure 10-1.
After the A/D module has been configured as desired,
the selected channel must be acquired before the con-
version is started. The analog input channels must
have their corresponding TRIS bits selected as inputs.
To determine sample time, see Section 10.1. After this
acquisition time has elapsed, the A/D conversion can
be started.
These steps should be followed for doing an A/D
conversion:
1.
FIGURE 10-1:
© 2006 Microchip Technology Inc.
Configure the A/D module:
• Configure analog pins/voltage reference and
• Select A/D input channel (ADCON0)
• Select A/D conversion clock (ADCON0)
• Turn on A/D module (ADCON0)
digital I/O (ADCON1)
Converter
A/D
A/D BLOCK DIAGRAM
(Reference
(Reference
Voltage)
Voltage)
V
V
REF
REF
-
+
(Input Voltage)
PCFG3:PCFG0
PCFG3:PCFG0
V
AIN
V
V
DD
SS
2.
3.
4.
5.
6.
7.
Configure A/D interrupt (if desired):
• Set PEIE bit
• Set GIE bit
Wait the required acquisition time.
Start conversion:
• Set GO/DONE bit (ADCON0)
Wait for A/D conversion to complete, by either:
• Polling for the GO/DONE bit to be cleared
• Waiting for the A/D interrupt
Read
(ADRESH:ADRESL), clear bit ADIF if required.
For the next conversion, go to step 1 or step 2,
as required. The A/D conversion time per bit is
defined as T
• Clear ADIF bit
• Set ADIE bit
(with interrupts enabled); OR
CHS2:CHS0
A/D
AD
100
011
010
001
000
.
Result
PIC16F872
register
RA1/AN1
RA2/AN2/V
RA0/AN0
RA5/AN4
RA3/AN3/V
DS30221C-page 81
REF
REF
pair
+
-

Related parts for PIC16F872-I/SP