The first test of every new microprocessor “single-board” project is free-run. Once the CPU, clock, and reset circuitry is in place, we hardwire the data bus to supply the data pins on the 6502 with its opcode NOP (No-Operation). The hexadecimal for the NOP instruction is $EA. This is a simple do-nothing opcode that basically increments the cpu’s internal program (address) counter by one, fetches the instruction at the new address (which happens to be another $EA), then continues on until it reaches the “reset vector” – the two bytes held at addresses $FFFC and $FFFD, at which it sees $EAEA. It then jumps to that address to continue on its merry way in an endless loop.
$FFFC and $FFFD are special addresses with the 6502. They hold the two bytes that make up the 16-bit address at which your program is to begin execution. Remember that each address can hold an 8 bit byte of data. So at $FFFC then $FFFD, the 6502 checks what two-byte word is supplied on the data pins.
We will tie the D0 – D7 pins either HIGH or LOW (0v or +5v) to make up the binary equivalent of $EA (hexadecimal) or:
Once our data pins are tied to $EA, we’ll monitor the address lines to verify that the 6502’s program counter is incrementing up from address $EAEA to $FFFC/$FFFD and back again.
One way we can do that is by wiring LEDs to each of the 16 address pins, then watching their two-byte representation of where the address is currently. We should see the LEDs count up in binary as the cpu steps through each address.
Another way is by rigging up a hexadecimal display, similar to Quinn Dunki’s HexOut display. In her blog, she explains how she rigged up four 7-segment LEDs through an EEPROM that decodes a 16-bit address into hexadecimal. I’ve taken a somewhat different approach by implementing four MC14495 Binary-to-Hexadecimal chips to do the heavy lifting to each of the four LED displays. Unfortunately, these chips are no longer made, and are becoming somewhat expensive and scarce. So programming an EEPROM to do the conversions is probably the better way to go.
Ben Eater, as part of his YouTube video series in building an 8-bit computer, has a video on making an EEPROM-decoded LED display. You should absolutely take a look at it, as well as the rest of his series in electronics.
The free-run circuit is completed:
Next step: Adding ROM and some I/O.