English
Language : 

PIC18F2331 Datasheet, PDF (113/396 Pages) Microchip Technology – 28/40/44-Pin Enhanced Flash Microcontrollers with nanoWatt Technology, High Performance PWM and A/D
PIC18F2331/2431/4331/4431
TABLE 10-1: PORTA FUNCTIONS
Name
Bit # Buffer
Function
RA0/AN0
bit 0 TTL Input/output or analog input.
RA1/AN1
bit 1 TTL Input/output or analog input.
RA2/AN2/VREF-/CAP1/INDX bit 2 TTL/ST Input/output, analog input, VREF-, capture input, or QEI Index
input.
RA3/AN3/VREF+/CAP2/QEA bit 3 TTL/ST Input/output, analog input, VREF+, capture input, or Quadrature
Channel A input.
RA4/AN4/CAP3/QEB
bit 4 TTL/ST Input/output, analog input, capture input, or Quadrature Channel
B input.
RA5/AN5/LVDIN
bit 5 TTL Input/output, analog input, or low-voltage detect input.
OSC2/CLKO/RA6
bit 6 TTL OSC2, clock output or I/O pin.
OSC1/CLKI/RA7
bit 7 TTL OSC1, clock input or I/O pin.
Legend: TTL = TTL input, ST = Schmitt Trigger input
TABLE 10-2: SUMMARY OF REGISTERS ASSOCIATED WITH PORTA
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
Resets
PORTA
LATA
TRISA
ADCON1
ANSEL0
ANSEL1
Legend:
Note 1:
2:
RA7(1)
RA6(1)
RA5
RA4
RA3
RA2
RA1
RA0 xx0x 0000 uu0u 0000
LATA7(1) LATA6(1) LATA Data Output Register
TRISA7(1) TRISA6(1) PORTA Data Direction Register
xxxx xxxx uuuu uuuu
1111 1111 1111 1111
VCFG1
ANS7(2)
—
VCFG0
ANS6(2)
—
—
ANS5(2)
—
FIFOEN
ANS4
—
BFEMT
ANS3
—
BFOVFL
ANS2
—
ADPNT1
ANS1
—
ADPNT0 00-1 0000 00-1 0000
ANS0 1111 1111 1111 1111
ANS8(2) ---- ---1 ---- ---1
x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by PORTA.
RA7:RA6 and their associated latch and data direction bits are enabled as I/O pins based on oscillator
configuration; otherwise, they are read as ‘0’.
ANS5 through ANS8 are available only on the PIC18F4X31 devices.
 2003 Microchip Technology Inc.
Preliminary
DS39616B-page 111