I am playing with interrupt mode 2 on a z80. Once pulled low it will disable interrupts and make a subroutine call to 0x0033. Before returning from the interrupt handler, interrupts should be explicitly activated through an opcode.
http://z80.info/zip/z80-interrupts_rewritten.pdf
Say I have a manual, debounced switch that, once pressed, will cleanly trigger this interrupt. Say the routine takes 80 clock cycles to complete at 8Mhz, ie 10us total before the interrupt will be re-activated.
I assume the manual switch press will last longer than 10us. That means that several interrupts will be processed on a single key press. I would like to avoid that.
Some solutions could be:
- don't use interrupts, silly, just do what everyone else does and just poll it.
- in the interrupt routine, poll the switch and only return after the swithc is reset.
That's all fine.
It however would be cool if there was a way to use discrete components outside the cpu to ensure that only a single interrupt is issued.
One thing that comes to mind is an RC circuit with a very fast (10us) cutoff.
But are there other solutions?