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 input channel (ADCON0)
• Select A/D conversion clock (ADCON0)
• Turn on A/D module (ADCON0)
2. Configure A/D interrupt (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set PEIE bit
• Set GIE bit
FIGURE 10-1:
A/D BLOCK DIAGRAM
PIC16C925/926
3. Wait the required acquisition time.
4. Start conversion:
• Set GO/DONE bit (ADCON0)
5. Wait for 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
6. Read A/D Result register pair
(ADRESH:ADRESL), clear bit ADIF if required.
7. For next conversion, go to step 1 or step 2 as
required. The A/D conversion time per bit is
defined as TAD. A minimum wait of 2TAD is
required before next acquisition starts.
VAIN
(Input Voltage)
A/D
Converter
VDD
VREF+
(Reference
Voltage)
PCFG<3:0>
CHS<2:0>
100
011
010
001
000
RA5/AN4
RA3/AN3/VREF+
RA2/AN2/VREF-
RA1/AN1
RA0/AN0
VREF-
(Reference
Voltage)
VSS
PCFG<3:0>
2001 Microchip Technology Inc.
Preliminary
DS39544A-page 77