Microchip Technology DM183037 Data Sheet

Page of 696
 2012 Microchip Technology Inc.
DS30575A-page 221
PIC18F97J94 FAMILY
11.13 Parallel Slave Port
PORTD can function as an 8-bit-wide Parallel Slave
Port (PSP), or microprocessor port, when control bit,
PSPMODE (PSPCON<4>), is set. The port is
asynchronously readable and writable by the external
world through the RD control input pin
(RE0/AD8/LCDBIAS1/RP28/RD) and WR control input
pin (RE1/AD9/LCDBIAS2/RP29/WR). 
The PSP can directly interface to an 8-bit micro-
processor data bus. The external microprocessor can
read or write the PORTD latch as an 8-bit latch.
Setting bit, PSPMODE, enables port pin,
RE0/AD8/LCDBIAS1/RP28/RD, to be the RD input,
RE1/AD9/LCDBIAS2/RP29/WR to be the WR input
and RE2/AD10/LCDBIAS3/RP30/CS to be the CS
(Chip Select) input. For this functionality, the corre-
sponding data direction bits of the TRISE register
(TRISE<2:0>) must be configured as inputs (‘111’).
A write to the PSP occurs when both the CS and WR
lines are first detected low and ends when either are
detected high. The PSPIF and IBF flag bits (PIR1<7>
and PSPCON<7>, respectively) are set when the write
ends.
A read from the PSP occurs when both the CS and RD
lines are first detected low. The data in PORTD is read
out and the OBF bit (PSPCON<6>) is set. If the user
writes new data to PORTD to set OBF, the data is
immediately read out, but the OBF bit is not set. 
When either the CS or RD line is detected high, the
PORTD pins return to the input state and the PSPIF bit
is set. User applications should wait for PSPIF to be set
before servicing the PSP. When this happens, the IBF
and OBF bits can be polled and the appropriate action
taken.
The timing for the control signals in Write and Read
modes is shown in 
respectively.
FIGURE 11-3:
PORTD AND PORTE 
BLOCK DIAGRAM 
(PARALLEL SLAVE PORT)   
Note:
The Parallel Slave Port is available only in
Microcontroller mode.
Data Bus
WR LATD
RDx
Q
D
CK
EN
Q
D
EN
RD PORTD
Pin
One Bit of PORTD
Set Interrupt Flag
PSPIF (PIR1<7>)
Read
Chip Select
Write
RD
CS
WR
Note: The I/O pin has protection diodes to V
DD
 and V
SS
.
TTL
TTL
TTL
TTL
or
PORTD
RD LATD
Data Latch
TRIS Latch