Microchip Technology IC MCU 8BIT PIC18F65K22-I/PT TQFP-64 MCP PIC18F65K22-I/PT Data Sheet

Product codes
PIC18F65K22-I/PT
Page of 550
PIC18F87K22 FAMILY
DS39960D-page 358
 2009-2011 Microchip Technology Inc.
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
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
ANSEL7
ANSEL6
ANSEL5
ANSEL4
ANSEL3
ANSEL2
ANSEL1
ANSEL0
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-0
ANSEL<7:0>: 
Analog Port Configuration bits (AN7 and AN0)
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
REGISTER 23-9:
ANCON1: A/D PORT CONFIGURATION REGISTER 1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
ANSEL15
)
ANSEL14
ANSEL13
ANSEL12
ANSEL11
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-0
ANSEL<15:8>:
 Analog Port Configuration bits (AN15 through AN8)
)
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
Note 1:
AN15 through AN12 and AN23 to AN20 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.