English
Language : 

PIC17C7XX Datasheet, PDF (89/328 Pages) Microchip Technology – High-Performance 8-Bit CMOS EPROM Microcontrollers with 10-bit A/D
10.9 PORTJ and DDRJ Registers
(PIC17C76X only)
PORTJ is an 8-bit wide bi-directional port. The corre-
sponding data direction register is DDRJ. A '1' in
DDRJ configures the corresponding port pin as an
input. A '0' in the DDRJ register configures the corre-
sponding port pin as an output. Reading PORTJ
reads the status of the pins, whereas writing to PORTJ
will write to the respective port latch.
PORTJ is a general purpose I/O port.
PIC17C7XX
EXAMPLE 10-1: INITIALIZING PORTJ
MOVLB
CLRF
MOVLW
MOVWF
8
PORTJ, F
0xCF
DDRJ
; Select Bank 8
; Initialize PORTJ data
; latches before setting
; the data direction
; register
; Value used to initialize
; data direction
; Set RJ<3:0> as inputs
; RJ<5:4> as outputs
; RJ<7:6> as inputs
Figure 10-19:PORTJ Block Diagram
D
Q
EENN
VDD
D
CK
P
Q
Q
D
N
Q CK
Note: I/O pins have protection diodes to VDD and Vss.
Data Bus
RD_PORTJ
WR_PORTJ
RD_DDRJ
WR_DDRJ
© 1998 Microchip Technology Inc.
DS30289A-page 89