Page 1 of 1

Single step the 6502

Posted: Mon Mar 03, 2003 1:20 pm
by ken_g
Can someone give me a quick explination on how to single step the 6502 processor? Is it just a matter of hooking up the RDY line to +V and have a switch on that line so it goes high every time I push the switch? Then push the switch every time I want to execute an instruction?

Thank you.
Ken Guenther

Posted: Mon Mar 03, 2003 3:15 pm
by schidester
Ken,

The RDY line is more of an on/off line; while high, the 6502 runs, while low, the 6502 stops. However, there are catches. If you pull RDY low at the wrong time (in reference to phase-2), the 6502 will lock up and have to be reset. Also, the plain NMOS 6502 cannot be stopped on a write cycle, but the CMOS 65C02 can.

This is crude, but on my SBC, I used a jumper to hold RDY high; when it's removed, a resistor pulls it low. I used this to do a simple test of the bus, where I could freeze it and examine the bus using a simple meter. The program under test executed seven bus cycles in a loop, so it was trial and error to get the correct access to be frozen when I pulled the jumper (and, sometimes, the processor did lock up). Crude, but for my purpose it got the job done.

To single-step the bus cycles, you must take into account phase-2, and only assert RDY for one bus cycle--then bring it low again. To single step instructions, you must use SYNC. A flip-flop circuit should do the trick; I've never built one, but maybe someone else can help here. I think a solution may have been posted to this forum, so just do a search.

Posted: Mon Mar 03, 2003 9:48 pm
by GARTHWILSON
> I think a solution may have been posted to this forum, so just do a search.

You'll find the recent discussion on this by going to
6502.org Forum Index -> Hardware
and then clicking on "6502 Hardware Single-step". At the time of this writing, it's four lines down from this subject just started, but the subject lines are sorted by last post date so that might change. In any case, you'll be able to find it easily.

Posted: Tue Mar 04, 2003 12:29 am
by ken_g
GARTHWILSON wrote:
> I think a solution may have been posted to this forum, so just do a search.

You'll find the recent discussion on this by going to
6502.org Forum Index -> Hardware
and then clicking on "6502 Hardware Single-step". At the time of this writing, it's four lines down from this subject just started, but the subject lines are sorted by last post date so that might change. In any case, you'll be able to find it easily.
Sorry... I'll open my eyes a little wider next time before I speak :-)