PIC16C63A/65B/73B/74B
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)
Configure A/D interrupt (if desired):
• Clear ADIF bit (PIR1<6>)
• Set ADIE bit (PIE1<6>)
• Set PEIE bit (INTCON<6>)
• Set GIE bit (INTCON<7>)
3.
4.
5.
Wait the required acquisition time.
Set GO/DONE bit (ADCON0) to start conversion.
Wait for A/D conversion to complete, by either:
Polling for the GO/DONE bit to be cleared (if
interrupts are disabled);
OR
Waiting for the A/D interrupt.
6.
7.
Read A/D result register (ADRES), clear bit
ADIF if required.
For next conversion, go to step 1 or step 2 as
required. The A/D conversion time per bit is
defined as T
AD
. A minimum wait of 2 T
AD
is
required before next acquisition starts.
2.
FIGURE 12-1:
A/D BLOCK DIAGRAM
CHS2:CHS0
111
110
101
100
RE2/AN7
(1)
RE1/AN6
(1)
RE0/AN5
(1)
RA5/AN4
V
IN
(Input Voltage)
011
010
RA3/AN3/V
REF
RA2/AN2
A/D
Converter
001
RA1/AN1
V
DD
000
or
010
or
100
or
11x
001
or
011
or
101
000
RA0/AN0
V
REF
(Reference
Voltage)
PCFG2:PCFG0
Note 1:
Not available on PIC16C73B.
2000 Microchip Technology Inc.
DS30605C-page 81