English
Language : 

PIC18F97J60_11 Datasheet, PDF (166/492 Pages) Microchip Technology – 64/80/100-Pin, High-Performance, 1-Mbit Flash Microcontrollers with Ethernet
PIC18F97J60 FAMILY
11.10 PORTJ, TRISJ and
LATJ Registers
Note: PORTJ is available only on 80-pin and
100-pin devices.
PORTJ is implemented as a bidirectional port in two
different ways:
• 80-pin devices: 2 bits wide (RJ<5:4>)
• 100-pin devices: 8 bits wide (RJ<7:0>)
The corresponding Data Direction register is TRISJ.
Setting a TRISJ bit (= 1) will make the corresponding
PORTJ pin an input (i.e., put the corresponding output
driver in a High-Impedance mode). Clearing a TRISJ
bit (= 0) will make the corresponding PORTJ pin an out-
put (i.e., put the contents of the output latch on the
selected pin). All pins on PORTJ are digital only and
tolerate voltages up to 5.5V.
The Output Latch register (LATJ) is also memory
mapped. Read-modify-write operations on the LATJ
register read and write the latched output value for
PORTJ.
All pins on PORTJ are implemented with Schmitt
Trigger input buffers. Each pin is individually
configurable as an input or output.
Note: These pins are configured as digital inputs
on any device Reset.
When the external memory interface is enabled, all of
the PORTJ pins function as control outputs for the
interface. This occurs automatically when the interface
is enabled by clearing the EBDIS control bit
(MEMCON<7>). The TRISJ bits are also overridden.
Each of the PORTJ pins has a weak internal pull-up. A
single control bit can turn on all the pull-ups. This is
performed by setting bit, RJPU (PORTA<7>). The
weak pull-up is automatically turned off when the port
pin is configured as an output. The pull-ups are
disabled on all device Resets.
EXAMPLE 11-9: INITIALIZING PORTJ
CLRF
CLRF
MOVLW
MOVWF
PORTJ
LATJ
0CFh
TRISJ
; Initialize PORTG by
; clearing output
; data latches
; Alternate method
; to clear output
; data latches
; Value used to
; initialize data
; direction
; Set RJ3:RJ0 as inputs
; RJ5:RJ4 as output
; RJ7:RJ6 as inputs
DS39762F-page 166
 2011 Microchip Technology Inc.