Microchip Technology DM183021 Data Sheet

Page of 392
 2010 Microchip Technology Inc.
 
DS39616D-page 245
PIC18F2331/2431/4331/4431
REGISTER 21-6:
ANSEL0: ANALOG SELECT REGISTER 0
(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
ANS7
(2)
ANS6
(2)
ANS5
(2)
ANS4
ANS3
ANS2
ANS1
ANS0
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
ANS<7:0>: 
Analog Input Function Select bits
Correspond to pins, AN<7:0>.
1
 = Analog input
0
 = Digital I/O
Note 1:
Setting a pin to an analog input disables the digital input buffer. The corresponding TRIS bit should be set 
for an input and cleared for an output (analog or digital). The ANSx bits directly correspond to the ANx pins 
(e.g., ANS0 = AN0, ANS1 = AN1, etc.). Unused ANSx bits are read as ‘0’. 
2:
ANS7 through ANS5 are available only on PIC18F4331/4431 devices.
REGISTER 21-7:
ANSEL1: ANALOG SELECT REGISTER 1
(1)
 
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R/W-1
ANS8
(2)
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-1
Unimplemented: 
Read as ‘0’
bit 0
ANS8: 
Analog Input Function Select bit
(2)
1
 = Analog input
0
 = Digital I/O
Note 1:
Setting a pin to an analog input disables the digital input buffer. The corresponding TRIS bit should be set 
for an input and cleared for an output (analog or digital). The ANSx bits directly correspond to the ANx pins 
(e.g., ANS8 = AN8, ANS9 = AN9, etc.). Unused ANSx bits are read as ‘0’.
2:
ANS8 is available only on PIC18F4331/4431 devices.