PIC16C745/765
The following steps should be followed for doing an A/D
conversion:
4. Start conversion:
• Set GO/DONE bit (ADCON0)
1. Configure the A/D module:
5. Wait for A/D conversion to complete, by either:
• Polling for the GO/DONE bit to be cleared
• Configure analog pins / voltage reference /
and digital I/O (ADCON1)
OR
• 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
• Waiting for the A/D interrupt
6. Read A/D result register (ADRES), 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.
• Set ADIE bit
• Set GIE bit
3. Wait the required acquisition time.
FIGURE 12-1: A/D BLOCK DIAGRAM
CHS<2:0>
111
RE2/AN7(1)
110
RE1/AN6(1)
101
RE0/AN5(1)
100
RA5/AN4
VIN
011
(Input voltage)
RA3/AN3/VREF
010
RA2/AN2
A/D
Converter
001
RA1/AN1
000
VDD
RA0/AN0
000or
010or
100or
11x
VREF
(Reference
voltage)
001or
011or
101
PCFG<2:0>
Note 1: Not available on PIC16C745.
1999 Microchip Technology Inc.
Advanced Information
DS41124A-page 91