A remark about your code, even though this is probably not related to GPIO "glitches".
Iirc, the Z80 nominally asserts MREQ and RD at the same time. However, if you happen to sample the GPIOs ("gpios = gpio_get_all64()") at precisely the transition, you might end up in a situation where MREQ reads as asserted (low), but RD still reads as de-asserted (high) as far as the RP2350 is concerned. This would make the following test "(gpios & rd_mask) == 0" fail and send you through another iteration of your while loop. I have no idea if this would break your timing...
Iirc, the Z80 nominally asserts MREQ and RD at the same time. However, if you happen to sample the GPIOs ("gpios = gpio_get_all64()") at precisely the transition, you might end up in a situation where MREQ reads as asserted (low), but RD still reads as de-asserted (high) as far as the RP2350 is concerned. This would make the following test "(gpios & rd_mask) == 0" fail and send you through another iteration of your while loop. I have no idea if this would break your timing...
Statistics: Posted by czietz — Tue Apr 08, 2025 5:17 pm