English
Language : 

PIC18F6390 Datasheet, PDF (129/412 Pages) Microchip Technology – 64/80-Pin Flash Microcontrollers with LCD Driver and nanoWatt Technology
PIC18F6390/6490/8390/8490
9.8 PORTH, LATH and
TRISH Registers
Note: PORTH is available only on 80-pin
devices.
PORTH is an 8-bit wide, bidirectional I/O port. The cor-
responding 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).
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.
Note: On a Power-on Reset, these pins are
configured as digital inputs.
PORTH is also multiplexed with LCD segment drives
controlled by the LCDSE5 register. I/O port functions
are only available when the segments are disabled.
EXAMPLE 9-8:
CLRF PORTH
CLRF LATH
MOVLW 0CFh
MOVWF TRISH
INITIALIZING PORTH
; Initialize PORTH by
; clearing output
; data latches
; Alternate method
; to clear output
; data latches
; Value used to
; initialize data
; direction
; Set RH3:RH0 as inputs
; RH5:RH4 as outputs
; RH7:RH6 as inputs
 2004 Microchip Technology Inc.
Preliminary
DS39629B-page 127