English
Language : 

PIC18F2331 Datasheet, PDF (251/396 Pages) Microchip Technology – 28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High Performance PWM and A/D
PIC18F2331/2431/4331/4431
REGISTER 20-6:
ANSEL0: ANALOG SELECT REGISTER 0(1)
R/W-1
ANS7(2)
R/W-1
ANS6(2)
R/W-1
ANS5(2)
R/W-1
ANS4
R/W-1
ANS3
bit 7
R/W-1
ANS2
R/W-1
ANS1
R/W-1
ANS0
bit 0
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 to be read as ‘0’.
2: ANS7 through ANS5 are available only on PIC18F4X31 devices.
Legend:
R = Readable bit
-n = Value at Reset
W = Writable bit
‘1’ = bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = bit is cleared x = bit is unknown
REGISTER 20-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 15
bit 8
bit 15-9 Unimplemented: Read as ‘0’
bit 8 ANS8: Analog Input Function Select bit
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 to be read as ‘0’.
2: ANS8 is available only on PIC18F4X31 devices.
Legend:
R = Readable bit
-n = Value at Reset
W = Writable bit
‘1’ = bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = bit is cleared x = bit is unknown
 2003 Microchip Technology Inc.
Preliminary
DS39616B-page 249