I'm thinking of picking back up an older project where I was connecting a Z80 to an AVR and using the AVR to handle the I/O so it will need to handle IN and OUT instructions.
My original plan was using a 74 flip flop that would assert the /WAIT line under the right conditions and then the AVR would notice the FF is set and handle the operation before clearing the flip flop and deasserting /WAIT. Originally I was going to use a 138 to trigger the flip flop by G1=A7, A=A6, B=A5, C=A4, G2A#=IORQ#, G2B#=FFCLEAR so that it would trigger the flip flop on any IN/OUT of 0xF0-0xFF as long as the /FFCLEAR was not asserted. This would allow the flip flop to be triggered (asserting /WAIT), but then allow me to to clear the flip flop even while /IORQ is still asserted.
Now I am simplifying and the AVR is the only I/O device, so I don't need to trigger on 0xF0-0FF any longer, any IN/OUT instruction should trigger. So basically I want to assert /WAIT when IORQ becomes asserted SO LONG AS ffclear is not asserted. I also thought, if IORQ isn't asserting on a low condition, but rather a transition from high to low, then I don't need to worry about the ffclear keeping it from retriggering the flip flop as it would only trigger the flip flop on a low going transition which will be later in another Z80 instruction.
Maybe I don't need a flip flop at all but some other type of logic. Basically I need to let the low going transition of IORQ assert WAIT, and I need a way to reset WAIT that might happen while IORQ may or may not still be low. Any thoughts on the lowest part count easiest way to do that? I remember thinking that I could feed the IORQ into the CLK line of the 7474 and perhaps use that as a way to make it trigger only on a high to low transition.