English
Language : 

PIC18F2331_07 Datasheet, PDF (115/400 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
RA5/AN5/LVDIN(1)
bit 4 TTL/ST Input/output, analog input, capture input or Quadrature
Channel B input.
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
Note 1: Only available on PIC18F4331/4431 devices.
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
RA7(1) RA6(1) RA5
RA4
RA3
RA2
LATA7(1) LATA6(1) LATA Data Output Register
TRISA7(1) TRISA6(1) PORTA Data Direction Register
RA1
RA0 xx0x 0000 uu0u 0000
xxxx xxxx uuuu uuuu
1111 1111 1111 1111
ADCON1 VCFG1
ANSEL0 ANS7(2)
ANSEL1 —
VCFG0
ANS6(2)
—
— FIFOEN BFEMT BFOVFL ADPNT1 ADPNT0 00-0 0000 00-1 0000
ANS5(2) ANS4 ANS3 ANS2 ANS1 ANS0 1111 1111 1111 1111
—
—
—
—
— ANS8(2) ---- ---1 ---- ---1
Legend:
Note 1:
2:
x = unknown, u = unchanged, - = unimplemented, 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 PIC18F4331/4431 devices.
© 2007 Microchip Technology Inc.
Preliminary
DS39616C-page 113