Z8 Microcontrollers
ZiLOG
I/O Ports
UM001600-Z8X0599
5-19
5.6 PORT HANDSHAKE
When Ports 0, 1, and 2 are configured for handshake op-
eration, a pair of lines from Port 3 are used for handshake
controls. The handshake controls are interlocked to prop-
erly time asynchronous data transfers between the Z8
and a peripheral. One control line (/DAV) functions as a
strobe from the sender to indicate to the receiver that data
is available. The second control line (RDY) acknowledges
receipt of the sender’s data, and indicates when the receiv-
er is ready to accept another data transfer.
In the input mode, data is latched into the Port’s input reg-
ister by the first /DAV signal, and is protected from being
overwritten if additional pulses occur on the /DAV line. This
overwrite protection is maintained until the port data is
read. In the output mode, data written to the port is not pro-
tected and can be overwritten by the Z8 during the hand-
shake sequence. To avoid losing data, the software must
not overwrite the port until the corresponding interrupt re-
quest indicates that the external device has latched the da-
ta.
The software can always read Port 3 output and input
handshake lines, but cannot write to the output handshake
line.
The following is the recommended setup sequence when
configuring a Port for handshake operation for the first time
after a reset:
Load P01M or P2M to configure the port for input/output.
Load P3 to set the Output Handshake bit to a logic 1.
Load P3M to select the Handshake Mode for the port.
Once a data transfer begins, the configuration of the hand-
shake lines should not be changed until the handshake is
completed.
Figures 5-23 and 5-24 show detailed operation for the
handshake sequence.