Perfection is achieved not when there is nothing more to add, but when there is nothing left to fail. Going by that metric, [Stian]’s three-chip 6502 homebrew computer is the epitome of perfection. It’s a real, working, homebrew retrocomputer using only three chips: a CPU, some RAM, and a microcontroller to bootstrap the computer and provide a video output,
The key to this minimalist build is having the entire boot process controlled by an ATMega16 microcontroller, This interfaces to the 6502 through a dual-port SRAM, a 1 kilobyte Cypress CY7C130. This dual-port RAM allows the CPU and microcontroller to access the same bit of memory, making it easy to bootstrap a computer from a bit of AVR code.
Output is provided with [Stian]’s ATMega video text generator putting a 37×17 characters on any television with an RCA jack. While input isn’t handled yet, [Stian] says it should be possible with his AVR PS/2 keyboard library.
While other 6502 homebrew computers such as [Quinn Dunki] Veronica can reach unparalleled heights of complexity, there is a lot to be said about the minimalism of [Stian]’s three-chip computer. With some clever coding and a modified parts list, it may well be possible to put a retrocomputer in the hands of everyone with a bare minimum of cost and parts.
When building a homebrew computer, there are a few milestones that make all the work seem worth it. Of course, seeing the CPU step through address lines on the blinkenlights is near the top, but even more important is being able to type a character on a keyboard and have it show up on a display. [Quinn] didn’t want her Veronica computer to deal with serial terminals or PS/2 keyboards when she typed her first characters in; instead she wanted to read a USB keyboard using 80s-era hardware.
Back in the early days of USB, design specs and keyboard manufacturers included a legacy mode in nearly every USB keyboard ever manufactured. This allows a USB keyboard to work with the ancient PS/2 protocol. [Quinn] tapped into that functionality nearly every PS/2 keyboard has using a 6522 Versatile Interface Adapter. This VIA is in the same family of chips as the venerable 6502 CPU that provides GPIO pins and timers.
[Quinn] connected the keyboard connector tapped for PS/2 input to an ATtiny13. This microcontroller reads the scan codes from the keyboards and sends them to the VIA and the rest of Veronica. It’s quite a bit of work to get to this point, but [Quinn] finally has a computer she can type on, the first step to developing software for her homebrew computer.
Gather ’round children, we’re about to hear a story about the good old days. Except that this is really more of a horror story of what it used to be like as a code monkey. [John Graham-Cumming] shares his experience programming a 6502-based KIM-1 machine back in 1985. Simple, right? The caveat being that there was no assembler or hardware for loading the finished code!
The machine in question was a label application tool for a production line. You know, product goes in bottle, label gets slapped on the side. But the slapping needed to be perfect because consumers shy away from packaging that looks shoddy. Computer control would end up being far superior than the mechanical means the factory had been using because it simplifies the ability to adjust calibration and other parameters. [John] started from square one by interfacing the KIM-1 with the existing hardware. It has a hex keyboard which is how the program was entered into the device. But first he wrote the software on sheets of notebook paper like the one seen above. It includes his hand assembled code, which was then typed in on the keypad. Kind of makes you appreciate all the tools you take for granted (like Eclipse), huh?
It seems strange that RAM is being added to a computer so late in the build, but [Quinn Dunki] must have had it in the back of her mind the whole time because it turns out to be a rather painless experience. For those of you keeping score, this makes her Veronica project Turing complete.
The brightly colored rats nest pictured above connects the new components to the 6502 computer backplane seen in the upper left. [Quinn] decided to go with two 32K SRAM modules which need very little in the way of drive hardware (it’s hanging out on the breadboard to the left). The RAM module will simply listen for its address and react accordingly. There is one hitch regarding a two-phase clock and the need to protect the RAM from erroneous data during the first of those phases.
Getting this all to work actually pointed out a bug in the ROM module she had long ago completed. After picking up on the problem she was able to correct it simply by cutting traces and soldering in jumper wires.
His friends know [gbg] as an aficionado of just about anything with a 6502 processor in it. He’s also interested in bitcoins. A while back, a friend asked if it would be possible to mine bitcoins with an old Nintendo Entertainment System. While this suggestion was made in jest, it’s not one of those ideas anyone can let go of easily. Yes, it is possible to mine bitcoins with an NES, and [gbg] is here to show us how.
Mining bitcoins is simply just performing a SHA256 hash on a random value from the bitcoin network and relaying the result of that calculation back to the Internet. Of course this requires an Internet to NES bridge; [gbg] brought in a Raspberry Pi for this task. There’s the problem of actually getting data into an NES, though, and that’s something only a USB CopyNES can handle. After doing some 32-bit math, the NES sends this out to the Raspberry Pi and onto the bitcoin network.
When you consider that even a high-end gaming computer has little chance of mining a bitcoin in any reasonable amount of time, there’s little chance RetroMiner will ever be able to mine a bitcoin. It’s all random, though, so while it’s possible, we’ll just appreciate the awesome build for now.
The screenshot on the right shows [Quinn Dunki’s] computer project displaying a Hello World program. Well, it’s only showing the word Hello right now, but the concept is the same. This proves that native 6502 code is running on the processor and reliably outputting data through its VGA hardware. That’s a welcome achievement after watching so much work go into this project.
But with anything this complex you can’t expect to make progress without finding bugs. And this step in the journey had a pretty big one in store for [Quinn]. After writing the assembly code and loading it into the machine she was dismayed to find that there were dropped characters all over the place. Now she shows a screenshot and says it’s easily recognizable as a race condition — proving she has a bigger brain than us.
The problem is a pair of uninterruptible processes running on the same AVR chip (part of the GPU she built). They are fighting with each other for control of the processor cycles and she fixed it by making the daughter board seen in the image above. It moves one of the time-critical processes out of that single AVR chip to fix the issue by using an IDT7200L FIFO SRAM chip.
[Mark] is just starting off on his own 6502 computer odyssey. He was inspired by some of the other projects we’ve seen around here, like [Quinn Dunki’s] Veronica Project, but with a spin that leverages modern processors to alleviate some of the messy work. As you can see above, there’s an Atmel chip perched above the 65C02 processor. This chip not only feeds the processor data (through all those slightly diagonal yellow wires) but also provides the clock signal and operates the reset and bus enable lines.
This is more of a hello world post for [Mark]. The chip is simply running NOP commands right now. But it shows that the basic idea works, and the video after the break lets us see another time-saving aspect of the circuit. He’s using a character LCD to display memory location and data values. The plan is to get a blog going, which he’s hesitant to do as it takes valuable hacking time away from the project. We disagree. The write-up (although incredibly fun for us to read) ends up being a reference manual for him once the project starts to get really hairy.
Continue reading “Another take on the 6502 computer”