English
Language : 

PIC18F87K22 Datasheet, PDF (355/548 Pages) Microchip Technology – 64/80-Pin, High-Performance, 1-Mbit Enhanced Flash Microcontrollers with 12-Bit A/D and nanoWatt XLP Technology
PIC18F87K22 FAMILY
The ANCONx registers are used to configure the
operation of the I/O pin associated with each analog
channel. Clearing an ANSELx bit configures the
corresponding pin (ANx) to operate as a digital only I/O.
Setting a bit configures the pin to operate as an analog
input for either the A/D Converter or the comparator
module, with all digital peripherals disabled and digital
inputs read as ‘0’.
As a rule, I/O pins that are multiplexed with analog
inputs default to analog operation on any device Reset.
REGISTER 23-8: ANCON0: A/D PORT CONFIGURATION REGISTER 0
R/W-1
ANSEL7
bit 7
R/W-1
ANSEL6
R/W-1
ANSEL5
R/W-1
ANSEL4
R/W-1
ANSEL3
R/W-1
ANSEL2
R/W-1
ANSEL1
R/W-1
ANSEL0
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 7-0
ANSEL<7:0>: Analog Port Configuration bits (AN7 and AN0)
1 = Pin configured as an analog channel; digital input is disabled and any inputs read as ‘0’
0 = Pin configured as a digital port
REGISTER 23-9: ANCON1: A/D PORT CONFIGURATION REGISTER 1
R/W-1
ANSEL15(1)
bit 7
R/W-1
ANSEL14(1)
R/W-1
ANSEL13(1)
R/W-1
ANSEL12(1)
R/W-1
ANSEL11
R/W-1
ANSEL10
R/W-1
ANSEL9
R/W-1
ANSEL8
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 7-0
ANSEL<15:8>: Analog Port Configuration bits (AN15 through AN8)
1 = Pin configured as an analog channel, digital input is disabled and any inputs read as ‘0’
0 = Pin configured as a digital port
Note 1: AN15 through AN12 and AN20 to AN23 are implemented only on 80-pin devices. For 64-pin devices, the
corresponding ANSELx bits are still implemented for these channels, but have no effect.
 2010 Microchip Technology Inc.
Preliminary
DS39960B-page 355