English
Language : 

PIC18F87J10 Datasheet, PDF (118/394 Pages) Microchip Technology – 64/80-Pin High-Performance, 1-Mbit Flash Microcontrollers with nanoWatt Technology
PIC18F87J10 FAMILY
10.1.2 INPUT PINS AND VOLTAGE
CONSIDERATIONS
The voltage tolerance of pins used as device inputs is
dependent on the pin’s input function. Pins that are used
as digital only inputs are able to handle DC voltages up
to 5.5V, a level typical for digital logic circuits. In contrast,
pins that also have analog input functions of any kind
can only tolerate voltages up to VDD. Voltage excursions
beyond VDD on these pins should be avoided.
Table 10-2 summarizes the input capabilities. Refer to
Section 26.0 “Electrical Characteristics” for more
details.
TABLE 10-2: INPUT VOLTAGE LEVELS
Port or Pin
Tolerated
Input
Description
PORTA<5:0>
PORTC<1:0>
VDD Only VDD input levels
tolerated.
PORTF<6:1>
PORTH<7:4>(1)
PORTB<7:0>
PORTC<7:2>
PORTD<7:0>
5.5V
Tolerates input levels
above VDD, useful for
most standard logic.
PORTE<7:0>
PORTF<7>
PORTG<4:0>
PORTH<3:0>(1)
PORTJ<7:0>(1)
Note 1: These ports are not available on 64-pin
devices.
10.2 PORTA, TRISA and
LATA Registers
PORTA is a 6-bit wide, bidirectional port. The corre-
sponding data direction register is TRISA. Setting a
TRISA bit (= 1) will make the corresponding PORTA pin
an input (i.e., put the corresponding output driver in a
high-impedance mode). Clearing a TRISA bit (= 0) will
make the corresponding PORTA pin an output (i.e., put
the contents of the output latch on the selected pin).
Reading the PORTA register reads the status of the
pins, whereas writing to it, will write to the port latch.
The Data Latch register (LATA) is also memory mapped.
Read-modify-write operations on the LATA register read
and write the latched output value for PORTA.
The RA4 pin is multiplexed with the Timer0 module
clock input to become the RA4/T0CKI pin. The other
PORTA pins are multiplexed with the analog VREF+ and
VREF- inputs. The operation of pins RA5:RA0 as A/D
converter inputs is selected by clearing or setting the
PCFG3:PCFG0 control bits in the ADCON1 register.
Note:
RA5 and RA3:RA0 are configured as
analog inputs on any Reset and are read
as ‘0’. RA4 is configured as a digital input.
The RA4/T0CKI pin is a Schmitt Trigger input. All other
PORTA pins have TTL input levels and full CMOS
output drivers.
The TRISA register controls the direction of the PORTA
pins, even when they are being used as analog inputs.
The user must ensure the bits in the TRISA register are
maintained set when using them as analog inputs.
EXAMPLE 10-1: INITIALIZING PORTA
CLRF
CLRF
MOVLW
MOVWF
MOVWF
MOVWF
MOVLW
MOVWF
PORTA
LATA
07h
ADCON1
07h
CMCON
0CFh
TRISA
; Initialize PORTA by
; clearing output
; data latches
; Alternate method
; to clear output
; data latches
; Configure A/D
; for digital inputs
; Configure comparators
; for digital input
; Value used to
; initialize data
; direction
; Set RA<3:0> as inputs
; RA<5:4> as outputs
DS39663A-page 116
Advance Information
 2005 Microchip Technology Inc.