blog.jmp.no

Electronics, coding and hacking. And ADD.

« 3CC, C64FC status C64 cart planning »

3 chip computer

2013
15
October

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
$0100-$01ff: Stack
$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.

Update: I took it one step further.


Share:

to 3 chip computer

Feed for this Entry

5 Comments

  • I'm particularly interested in how the atmega connects to the RAM so as to not contend with the 6502. Can you go into more detail on that subject?

    Thanks!

    #643 | Comment by Samuel Falvo II on Oct 18, 2013 12:05am
  • Hi!

    The dual-port RAM has *two* interfaces to the same memory content. The 6502 is connected to the one, and the ATmega to the other. The DPRAM has internal buffering that resolves any potential conflicts.

    The datasheet for the CY7C130 is here: http://www.cypress.com/?docID=40949

    I tried to solve this with a traditional SRAM earlier without any particular success. I have some theories that might work (and I will try them sometime) but for now I'll just stick with the DPRAM.

    #644 | Comment by admin on Oct 18, 2013 09:00am
  • Awesome project. I had no idea that dual port ram even existed. Very cool, and thanks for sharing.

    #647 | Comment by Aidan on Oct 22, 2013 12:20pm
  • Can you make schematics available, I would really like to learn how to build a DIY computer and think this would be a good start. And/Or could you point me in a good direction to start?

    #648 | Comment by Peter on Oct 23, 2013 12:18am
  • Hi Peter,

    This *could* be a good place to start, although the ATmega involved is a hack you should try to avoid. Using an EPROM and perhaps serial output is more the "right way" of doing it.

    I've posted another video demonstrating I/O with keyboard and video at the same time. As you can see, the screen flickers on every keypress, and if you type too fast the TV will eventually lose SYNC and the screen will go black for a few seconds. Getting this to run flawlessly would require some major hacking on the AVR.

    That being said, the current setup works, it gets the job done and it fits on a small breadboard. I don't have any schematics for the setup right now, unfortunately, as it was all improvised on the fly...

    #652 | Comment by admin on Oct 25, 2013 09:46am

About You

Email address is not published

Add to the Discussion

Add to Google