Dan Moos wrote:
I think I understand this, but want to be sure I know exactly what's happening with a hardwired NOP test.
Tell me if this is right:
CPU comes on. I presume the first thing it does is look in a specific address for directions to first instruction. Since $EA is what it finds at this "address", it puts the instruction pointer at address location $EAEA. Thinking it's at this address, it executes the data it finds (NOP). It then advances the program counter, always finding a NOP instruction. It did this until it reaches the last address, after which I presume it starts over, this time at $0000.
Do I have that sequence correct?
Yes.
Quote:
Next, if I want to observe the addresses incrementing, can I hook the address bus directly to the GPIO pins of a microcontroller without some sort of buffer? I can't see why not. I'd like to use an Arduino to read the bus, and display the results in a serial terminal.
Can I hook the bus directly to the Arduinos GPIO pins? I figure since everything is CMOS, no real current gets sourced by the CPU, and all is safe. It's this correct?
You can do it that way, but you will probably have to slow the 6502's clock down to really see anything. Otherwise the high digit of a hexadecimal address display will change 122 times per second using $EA. If the 6502 is running at 1MHz, it will be at each address for 2µs if you use $EA, or 1µs for something like A9 (LDA #$A9). The Arduino will read invalid inputs at those time that the address happens to be changing between the Arduino port's set-up time and the hold time. If you can sync them, that won't be a problem; but maybe it's not anyway because the display will be changing too fast to see anything anyway.