Datasheet
PIC18F66K80 FAMILY
DS39977F-page 364 2010-2012 Microchip Technology Inc.
The analog reference voltage is software selectable to
either the device’s positive and negative supply voltage
(AV
DD and AVSS) or the voltage level on the
RA3/V
REF+/AN3 and RA2/VREF-/AN2 pins. VREF+ has
two additional internal voltage reference selections:
2.0V and 4.1V.
The A/D Converter can uniquely operate while the
device is in Sleep mode. To operate in
Sleep, the A/D
conversion clock must be derived from the A/D’s
internal RC oscillator.
The output of the sample and hold is the input into the
converter, which generates the result via successive
approximation.
Each port pin associated with the A/D Converter can be
configured as an analog input or a digital I/O. The
ADRESH and ADRESL registers contain the result of
the A/D conversion. When the A/D conversion is com-
plete, the result is loaded into the ADRESH:ADRESL
register pair, the GO/DONE
bit (ADCON0<1>) is cleared
and the A/D Interrupt Flag bit, ADIF (PIR1<6>), is set.
A device Reset forces all registers to their Reset state.
This forces the A/D module to be turned off and any
conversion in progress is aborted. The value in the
ADRESH:ADRESL register pair is not modified for a
Power-on Reset. These registers will contain unknown
data after a Power-on Reset.
The block diagram of the A/D module is shown in
Figure 23-4.
REGISTER 23-9: ANCON1: A/D PORT CONFIGURATION REGISTER 1
U-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1 R/W-1
— ANSEL14
(1)
ANSEL13
(1)
ANSEL12
(1)
ANSEL11
(1)
ANSEL10 ANSEL9 ANSEL8
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7
Unimplemented: Read as ‘0’
bit 6
ANSEL14: RD3/C2INB Pin Analog Enable bit
(1)
1 = Pin is configured as an analog channel; digital input is disabled and any inputs read as ‘0’
0 = Pin is configured as a digital port
bit 5
ANSEL13: RD2/C2INA Pin Analog Enable bit
(1)
1 = Pin is configured as an analog channel; digital input is disabled and any inputs read as ‘0’
0 = Pin is configured as a digital port
bit 4
ANSEL12: RD1/C1INB Pin Analog Enable bit
(1)
1 = Pin is configured as an analog channel; digital input is disabled and any inputs read as ‘0’
0 = Pin is configured as a digital port
bit 3
ANSEL11: RD0/C1INA Pin Analog Enable bit
(1)
1 = Pin is configured as an analog channel: digital input disabled and any inputs read as ‘0’
0 = Pin is configured as a digital port
bit 2-0
ANSEL11<10:8>: Analog Port Configuration bits (AN10 through AN8)
1 = Pin is configured as an analog channel; digital input is disabled and any inputs read as ‘0’
0 = Pin configured as a digital port
Note 1: AN14 through AN11 and AN7 to AN5 are implemented only on 40/44-pin and 64-pin devices. For 28-pin
devices, the corresponding ANSELx bits are still implemented for these channels, but have no effect.