English
Language : 

PIC18F97J60_11 Datasheet, PDF (146/492 Pages) Microchip Technology – 64/80/100-Pin, High-Performance, 1-Mbit Flash Microcontrollers with Ethernet
PIC18F97J60 FAMILY
11.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 are always to be avoided.
Table 11-2 summarizes the input capabilities. Refer to
Section 28.0 “Electrical Characteristics” for more
details.
TABLE 11-2: INPUT VOLTAGE LEVELS
Port or Pin
Tolerated
Input
Description
PORTA<5,3:0>
PORTF<6:1>(1)
VDD Only VDD input levels
tolerated.
PORTH<7:4>(2)
PORTA<4>
PORTB<7:0>
PORTC<7:0>
5.5V
Tolerates input levels
above VDD, useful for
most standard logic.
PORTD<7:0>(1)
PORTE<7:0>
PORTF<7>
PORTG<7:0>(1)
PORTH<3:0>(2)
PORTJ<7:0>(2)
Note 1: Partially implemented on 64-pin and
80-pin devices; fully implemented on
100-pin devices.
2: Unavailable in 64-pin devices.
11.2 PORTA, TRISA and
LATA Registers
PORTA is a 6-bit wide, bidirectional port; it is fully
implemented on all devices. The corresponding 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 Output 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, RA<5:0>, as A/D
Converter inputs is selected by clearing or setting the
PCFG<3:0> control bits in the ADCON1 register.
Note:
RA5 and RA<3:0> 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.
The RA0 and RA1 pins can also be configured as the
outputs for the two Ethernet LED indicators. When
configured, these two pins are the only pins on PORTA
that are capable of high output drive levels.
Although the port is only six bits wide, PORTA<7> is
implemented as RJPU, the weak pull-up control bit for
PORTJ. In a similar fashion, the LATA<7:6> bits are
implemented, not as latch bits, but the pull-up control
bits, RDPU and REPU, for PORTD and PORTE.
Setting these bits enables the pull-ups for the corre-
sponding port. Because their port pins are not used, the
TRISA<7:6> bits are not implemented.
EXAMPLE 11-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
DS39762F-page 146
 2011 Microchip Technology Inc.