6502 with Arduino RAM/ROM

Tom Deckers
2 min readDec 14, 2020

--

I got fascinated by the 6502 thanks to the fabulous video series by Ben Eater. I got especially excited about the little device once I found out that the chip was used in the original NES game console, which brought joy to my young rainy days. A new goal was set: get a 6502 processor and get it to do… something. No plans beyond that for now.

I like to take things one step at a time and keep the overview. I like Ben’s way of stepping through the code on the actual processor. I wasn’t interested in a 6502 simulator at this point. That seemed a bit too easy. At the same time I didn’t want to build Ben’s clock module as I was too impatient to get the 6502 powered up. So why not use the Arduino to take control of things.

The simplest setup to get the 6502 running is to plug the processor in a breadboard, hook up an Arduino Mega. Below is a schematic of what I have put together.

In short:

  • Connect power and ground
  • Create a simple reset circuit
  • Connect the data and address bus to the arduino. Pay attention of LSB/MSB order.
  • Connect clock and RW pins

Lastly, load up following program into the Arduino IDE and upload it.

The Arduino code defines

  • RAM starting at RAM_START. Note that the stack is also included in this range. So JSR commands will just work since the arduino will act as RAM.
  • ROM is starting at ROM_START. This is where the program is loaded.

You can control the pace of execution by setting the f variable to a number in Hz. Note that this is used for mild testing. Couple 100 Hz might work. Don’t count on reliable operation beyond that.

Using PIN 4 on the Arduino you can either run the program continuously by pulling the pin low. Or just pulse it low using a wire to step through the program. Ben’s original monitor code will print to the serial output.

Even though this started a a small project without much further plans, I now got my sights set on being able to run BASIC on the little device. If that goes anywhere you’ll read about it here.

--

--