English
Language : 

PIC18F97J60 Datasheet, PDF (158/474 Pages) Microchip Technology – 64/80/100-Pin, High-Performance, 1 Mbit Flash Microcontrollers with Ethernet
PIC18F97J60 FAMILY
10.9 PORTH, LATH and
TRISH Registers
Note: PORTH is available only on 80-pin and
100-pin devices.
PORTH is an 8-bit wide, bidirectional I/O port; it is fully
implemented on 80-pin and 100-pin devices. The
corresponding data direction register is TRISH. Setting
a TRISH bit (= 1) will make the corresponding PORTH
pin an input (i.e., put the corresponding output driver in
a high-impedance mode). Clearing a TRISH bit (= 0)
will make the corresponding PORTH pin an output (i.e.,
put the contents of the output latch on the selected pin).
PORTH<3:0> pins are digital only and tolerate voltages
up to 5.5V.
The Data Latch register (LATH) is also memory
mapped. Read-modify-write operations on the LATH
register read and write the latched output value for
PORTH.
All pins on PORTH are implemented with Schmitt
Trigger input buffers. Each pin is individually
configurable as an input or output.
When the external memory interface is enabled, four of
the PORTH pins function as the high-order address
lines for the interface. The address output from the
interface takes priority over other digital I/O. The
corresponding TRISH bits are also overridden.
PORTH pins, RH4 through RH7, are multiplexed with
analog converter inputs. The operation of these pins as
analog inputs is selected by clearing or setting the
PCFG3:PCFG0 control bits in the ADCON1 register.
PORTH can also be configured as the alternate
Enhanced PWM output channels B and C for the
ECCP1 and ECCP3 modules. This is done by clearing
the ECCPMX Configuration bit.
EXAMPLE 10-8:
CLRF PORTH
CLRF LATH
MOVLW
MOVWF
MOVLW
0Fh
ADCON1
0CFh
MOVWF TRISH
INITIALIZING PORTH
; Initialize PORTH by
; clearing output
; data latches
; Alternate method
; to clear output
; data latches
; Configure PORTH as
; digital I/O
; Value used to
; initialize data
; direction
; Set RH3:RH0 as inputs
; RH5:RH4 as outputs
; RH7:RH6 as inputs
DS39762A-page 156
Advance Information
© 2006 Microchip Technology Inc.