Woz's 6502 single stepping circuit (attached below) has been covered already in this forum. The goal of this circuit is to generate a low-going pulse of RDY that lasts only a single clock cycle. This allows an external process to pause the CPU during execution, and examine the contents of the busses.
To make use of such a circuit, the rest of the glue logic needs to be adapted. /RD and /WR pulses going to memory need to stay active while RDY is low. Additionally, if using a 65C816, the bank address latch needs to stay closed, and the data bus buffer needs to stay on. Finally, I/O devices such as the 65C21, 65C22 and 65C51 use a direct clock input, and this also needs to stay high while RDY is low. This is to prevent reads and writes to be repeated in a loop between stepping pulses, and for the data bus to remain valid. Of course this messes with the VIA's timers. I think a solution to that can be found by isolating the VIA but I'll talk about that later.
We also need to make sure that RDY does not change when the clock is low, to avoid generating spurious reads and writes with the logic below:
Code: Select all
!RD = (CLK || !RDY) && RWB
!WR = (CLK || !RDY) && !RWB
# For I/O chips (not if using VIA's timers)
IOCLK = CLK || !RDY
# For 65C816
573_LE = !(CLK || !RDY)
!245_OE = CLK || !RDY
So, here is my version of the circuit. I was able to squeeze it in 3 chips, by removing the instruction single stepping I don't need (with SYNC).
I hope this is useful to someone else! I'm also attaching a Digital simulation to try it out. Feedback is welcome!