Quoted from slochar:So looking through the code, seems like you're HALTing the 6800, which tristates it. Am I right in assuming that you can take over the bus at that point via the arduino and address memory locations? i.e. see what's in the ram, etc. - I know that won't get the 6800 registers from the processor (there'd have to be a 6800 emulator running on the arduino to get that) but at least contents of ram could be explored as a debugger? That might get me where I'd like to go with this. I plan on trying out the code on my stars next week with an ancient Duemilenove I have laying around.
I know the debugger memory stuff would require many more I/O pins (although not so much if I just want the Ram contents, nothing with roms).
Maybe I can rig something with an external interrupt to have the processor save the registers into memory somewhere (the extended ram in the weebly board would help here) - what does the 6800 do when it comes out of HALT? All its registers are internal so does it just resume where it left off or does it reset?
Still keeping the dream of a monitor alive.....
Yes (and no) - you're right that the latest version of the daughter card that I'm running halts the 6800 (I'll attach a diagram).
So, yes, the Arduino can access the bus and read memory. But there are a couple of big caveats that I think might mean you need a different solution for what you want. First, the 6800 is HALTed by grounding the halt line for the duration that the machine is on. I only halt/un-halt with the machine turned off. That's partly because I don't have an extra pin on the Arduino to spare for driving that line.
And, because of the number of IO pins available on a Nano, I only have 5 address lines. So you could technically read addresses 0x0000 - 0x0003, 0x0008 - 0x000B, 0x0010 - 0x0013, 0x0018 - 0x001B of RAM, but that's it.
For what you're looking to do, I would recommend a Arduino Mega, which would have all the pins to cover the Address/Data/Control lines. Then, (if you jumpered a line from the Arduino to pin 6) you could run software that watches for a particular address and then calls an NMI and halts the processor.
Once inside the NMI, you would be able to see the contents of the register on the stack.
Another solution (and this one is WAY out there), is I have another program that Emulates the 6800 on an Arduino. It's basically a software implementation of the 6800 and the input is a 4k array of bytes (the original ROM). I have this running on an MPU100, but it's not 100% debugged. I can get the emulation through the 7 flashes, but the interrupt never decrements 0x0018 (I don't know why) and it gets hung up here:
LDAB #$03 *12F1: C6 03 '..'
Z12F3 STAB M0018 *12F3: D7 18 '..'
Z12F5 LDAB M0018 *12F5: D6 18 '..'
BNE Z12F5 *12F7: 26 FC '&.'
It loops forever back to 0x12F5, waiting for the ISR to clear out 0x0018.
Anyway, that's another approach you could try, but the emulation clearly isn't perfect for the ISR, so there's some debugging to do.
If you really want to break and examen registers, I think your best bet is the Mega & using the NMI.
I'd be happy to work with you on the code for this if you want to give it a try.
Wiring rev3 (resized).pngWiring rev3a (resized).png