beautypg.com

Selecting an operating mode, Table 19, Pio mode selection – Zilog Z08470 User Manual

Page 209

background image

< %27 2GTKRJGTCNU

7UGT /CPWCN

UM008101-0601

Parallel Input/Output

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:

Listed in Table 1, Bits D7 and D6 form the binary code that designate mode
of operation:

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

Table 1. PIO Mode Selection

D7

D6

Mode

0

0

0 (output)

0

1

1 (input)

1

0

2 (bidirectional)

1

1

3 (control)

Mode Word

M1

M0

X

X

Signifies Mode Word to be Set

D7

D6

D5

D4

D3

D0

D2

D1

1

1

1

1

This manual is related to the following products: