English
Language : 

Z80 Datasheet, PDF (209/330 Pages) Zilog, Inc. – Z80 CPU PERIPHERALS
< %27 2GTKRJGTCNU
7UGT /CPWCN

Selecting An Operating Mode
PIO Port A allows operation in four modes: Mode 0 (output mode), Mode 1
(input mode), Mode 2 (bidirectional mode), and Mode 3 (control mode).
The mode numbers are assigned for mnemonic significance: 0 = Out,
1 = In, 2 = Bidirectional. Port B cannot operate in Mode 2.
The mode of operation must be established by writing a control word to the
PIO in the following format:
D7 D6 D5 D4 D3 D2 D1 D0
M1 M0 X X 1 1 1 1
Mode Word
Signifies Mode Word to be Set
Listed in Table 1, Bits D7 and D6 form the binary code that designate mode
of operation:
Table 1. PIO Mode Selection
D7
D6
0
0
0
1
1
0
1
1
Mode
0 (output)
1 (input)
2 (bidirectional)
3 (control)
Bits D5 and D4 are ignored. Bits D3-D0 must be set to 1111 to indicate
Set Mode.
Selecting Mode 0 enables any data written to the port output register by
the CPU to be enabled onto the port data bus. The output register contents
may be changed by writing a new data word to the port. Also, the current
contents of the output register may be read back to the Z80 CPU by
executing an input instruction.
When Mode 0 is active, a data write from the CPU causes the port’s
Ready handshake line to go High, thereby notifying the peripheral that
UM008101-0601
Parallel Input/Output