Electronic – How to wire up multiple Z80 PIO chips

z80

From my last question, I now understand how to use one Z80 PIO chip.

I'm having trouble understanding how I would wire multiple PIOs up, though. The more I think about it, the less sense it makes.

I mean, I can think of a few ways to do this:

  • Use a demultiplexer with, say, the last 3 bits of the address bus as inputs, and then connect each output to the enable pin of a different PIO chip. The issue I see here is, how do I then use the A/B and C/D pins on the PIOs?
  • Use the first two bits of the address bus for A/B and C/D pins, and use the rest to indivually select each PIO chip. The issue here is that unless I'm careful whilst addressing the ports, I could enable two PIOs at the same time.

So, none of these two ways seem to be the "right" way to do it. Is there a standard way of achieving multiple PIOs being controlled by the Z80?

Best Answer

I've never built a Z80 computer (or any other) but have had to explain basic micro-computer operation to maintenance personnel and I found this schematic very useful. With a little study you should be able to find a variety of clever techniques and tricks the designer used to get the most out of the limited number of address lines available.

enter image description hereFigure 1. The Z80 computer. (Click to enlarge.) Source: Z80.info.

The linked article and schematic are worth a read.

Is there a standard way of achieving multiple PIOs being controlled by the Z80?

Again, I have no expertise in this area but I imagine that every trick possible was used to get the best out of these devices.