As I'm waiting for the cartridge PCB to be finished, my idle hands are itching. So, last night I decided do something just to keep them busy. I had a quick look around, and saw this breadboard next to me which had three chips installed: a CPU, a microcontroller and a RAM chip.
More specifically, a Rockwell R6502P, ATmega16 with 12MHz crystal, and a 1K CY7C130 dual-port RAM chip. I wonder: could I make a rudimentary computer with just these components? With the ATmega in place, it's definitely plausible. Also, since there's no ROM here, the RAM will have to play both roles, but that's fine, the ATmega can prepare the memory for that purpose.
I started off by loading a modified version of amvtg onto the controller, for generating composite video signals. I then proceeded to create a bus between the RAM chip and the ATmega, so that it could read and write memory. The 6502 was interfaced in a similar fashion on the opposite side of the RAM chip. I also added a reset button, a 1MHz tank oscillator and a few capacitors to the rails.
1K of memory is not much, so I had to map the memory carefully. I came up with the following scheme:
$0000-$00ff: Zero page
$0200-$02ff: Video memory
$0300-$03ff: ROM (firmware)
The ROM image I wrote would simply poke the letters 'O' and 'K' to $0200-$0201, and then loop forever. This would be more than enough for a proof-of-concept.
And, lo and behold, it works! The 6502 reads the "ROM", processes it, and writes "OK" to memory. The ATmega reads the memory and generates the video signals on the fly. Just to make sure this wasn't some freak accident, I added a blinking cursor - and, yes - it runs just fine:
..and by the time I got to this point, it was time for bed. Technically speaking, this is a computer, although it lacks some input functionality. It could easily have been added using atps2key, and I might add that later - just for the heck of it.
Tonight's project wasn't really a progress in any direction, but a fun one-night hack to play with. Unfortunately it was all wired up as I went along, so there's no schematic available at the moment. Should anyone be interested, just let me know and I'll whip something up.