0010 – Free Run and Hex Display

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:

D7 D6 D5 D4 D3 D2 D1 D0
1 1 1 0 1 0 1 0

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.

Arduino EEPROM Programmer
The hexadecimal display allows me to see what’s on the address or data lines. (The second display has a burned out segment, which is why the “d” looks like a backward “h”.

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:

Free-Run circuit, laid out on my Heathkit ET-3300 Breadboard.
The basics – 6502 hardwired to read $EA on the data pins, reset circuitry and clock (fed through a 74LS74 Dual flip-flop that outputs an even square and halved signal at 500kHz).

Next step: Adding ROM and some I/O.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s