data sheet
[url][http://map.grauw.nl/resources/sound/generalinstrument_ay-3-8910.pdf/url]
I see some problems with DA7-DA0 when directly connected to Z80 data bus.
#1 a Z80 Read from AY-3-8912
Fig. 11 Tristate Delay Time (Tts) = 400 ns
PSG driving data buss after Z80 read
#2 a Z80 Write to AY-3-8912
Fig. 10 Write Data Hold Time (Tdh) = 400 ns
PSG needing data stable after end of Z80 Write
#3 a Z80 Write address to AY-3-8912
Fig. 9 Address Hold Time(Tah) = 50 ns
PSG needing data stable after end of Z80 Write
I should not leave out the Write to PSG time of 1950 ns.
For #1 A Tristate buffer between Z80 & PSG DA7-DA0 might work.
For #2 & #3 a data latch between Z80 & PSG DA7-DA0 might work.
A latch is probably needed for PSG's Bus Control Decode.
This now looks more like what a 8255 or PIO does, but could be done with standard logic. You might think of this as bit-banging or creating the interface bus.
Okay guys, I have to admit to half of the conversation so far completely going over my head.
When things are going over your head, Say something & ask questions.
1. As long as you use the Z80 as it is designed to be used, then M1 is not needed for a IO read or write.
WR's rising transition is when actual write should happen. Data direction is from
Z80. The data written should be stable before this time and meet timing needs of chip being written.
RD is used to put data on data bus with direction to Z80 One driver per line of data bus. For example for memory that is many chips, only one can have and enabled path back to Z80. This is normally one 8-bit wide memory chip.
MERQ & IORQ are selectors of which address space is to be used. These signals also specify when address bus becomes a valid stable address.
So I just need to redesign the interface, using ~WR and A0 for BDIR and BC1 respectively, and gate those two signals with ~IORQ and ~M1 somehow to ensure that BDIR and BC1 are held LOW, no matter what ~WR and A0 are doing, if ~M1 is LOW or ~IORQ is HIGH?
With the timings above and need of latches, buffers, a PIO is low chip count interface. The Z80 software working with PIO needs to create proper timing for PSG.