English
Language : 

PIC16F7X Datasheet, PDF (87/174 Pages) Microchip Technology – 28/40-Pin 8-Bit CMOS FLASH Microcontrollers
PIC16F7X
The following steps should be followed for doing an
A/D conversion:
1. Configure the A/D module:
• Configure analog pins, voltage reference,
and digital I/O (ADCON1)
• Select A/D conversion clock (ADCON0)
• Turn on A/D module (ADCON0)
2. Configure the A/D interrupt (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set PEIE bit
• Set GIE bit
3. Select an A/D input channel (ADCON0).
FIGURE 11-1:
A/D BLOCK DIAGRAM
4. Wait for at least an appropriate acquisition
period.
5. Start conversion:
• Set GO/DONE bit (ADCON0)
6. Wait for the A/D conversion to complete, by
either:
• Polling for the GO/DONE bit to be cleared
(interrupts disabled)
OR
• Waiting for the A/D interrupt
7. Read A/D result register (ADRES), and clear bit
ADIF if required.
8. For next conversion, go to step 3 or step 4, as
required.
CHS2:CHS0
111
RE2/AN7(1)
110
RE1/AN6(1)
101
RE0/AN5(1)
VIN
(Input Voltage)
100
RA5/AN4
011
RA3/AN3/VREF
A/D
Converter
010
RA2/AN2
001
RA1/AN1
VREF
VDD
000
RA0/AN0
000 or
010 or
100 or
11x
(Reference
Voltage)
001 or
011 or
101
PCFG2:PCFG0
Note 1: Not available on PIC16F73/76.
 2002 Microchip Technology Inc.
DS30325B-page 85