Parallel Port Interface
9-12
MC68322 USER’S MANUAL
MOTOROLA
9.5 ERROR CYCLES
An example of an error cycle is when the user takes the printer off-line, a paper jam occurs,
or the printer runs out of paper. When any of these or other events occur, the printer runs
an error cycle to alert the host of a change in the operational status of the printer. An error
cycle consists of asserting the BUSY signal and changing the states of SELECT, PERROR,
and/or FAULT to reflect the error condition. This is done by manipulating the ERC bit in the
PPCR, which in turn triggers the PPI to set or clear bits in the PIER.
In compatibility mode, the software sets ERC to notify the PPI when an error cycle occurs.
This causes the PPI to immediately set the BSY1 bit in the PIER. After 1
s, the software
can set or clear the SEL, PER, or FLT bits in the PPIR, to indicate the error condition. After
the error condition is cleared, the software returns the SEL, PRR, and FLT to their normal
negated state. After 1
s, the software clears ERC, and the handshake logic concludes the
cycle by generating an ACK pulse and clearing BSY1.
If ERC is set and then STROBE is received from the host, then the handshake logic
performs the data transfer and data is still latched, but no acknowledge is generated until
ERC is cleared. In other words, the ERC bit prevents the handshake logic from generating
an ACK pulse and clearing BSY1. Instead, ACK1 and BSY1 remain set in the PPIR and the
transfer cycle is extended. As long as ERC remains set, BUSY remains high, and the
software can manipulate status lines to indicate the error condition. After the error condition
is cleared, the software returns the SEL, PER, and FLT bits in the PPIR to their normal
negated state. After 1
s the software clears ERC, and the handshake logic concludes the
cycle by generating an ACK pulse and clearing BSY1.
If ERC is set when the handshake logic is in the middle of a transfer, data is still latched, but
no acknowledge is generated until ERC is cleared. In other words, ERC prevents the
handshake logic from generating an ACK pulse and clearing BSY1. If ERC happens to be
set near the end of the cycle after the handshake logic has begun to generate an ACK pulse,
the hardware continues to produce the ACK pulse as normal. Setting ERC does not affect
an ACK pulse that is already active, but does prevent an ACK pulse that hasn’t yet started
(as described above). This behavior can result in two ACK pulses being generated while
BUSY is high. The first ACK is generated in response to STROBE and the second after ERC
is cleared. Figure 9-7 illustrates the timing diagram for an error cycle.
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.