Building a homebrew computer
Can an electronics novice construct an 8-bit machine from scratch?
After months of reading, chin stroking and after a heavy bout of good old nostalgia. I’ve finally decided to have a go at building my own 8-bit computer. Inspired by those homebrew superstars Quin Dunki, Grant Searl, Garth Wilson and absolutely everyone at 6502.org. I’m taking the plunge. Internet, here’s yet another homebrew computer.
The goal: a home-made simple 8-bit machine much like those early computers of the 70s, in which hobbyist electronics geniuses would build pioneering computers in their shed, setting off the whole home computing boom. The problem is of course that I’m not a genius, I’m not an electrical engineer and I don’t even have a shed. Let’s be honest, I don’t really know what I’m doing at all.
These days, thanks to the internet, there should be nothing to stop any enthusiastic (some might say naive) nostalgia-fuelled nerd, of a certain age, from cobbling together a simple 8-bit computer just like those early pioneers. I will be leaning heavily on Google and various projects from other people. But I don’t want to just copy someone else’s machine or assemble a kit. I really want to make this my own and try to learn what made these early computers tick.
Of course, a hobbyist’s home-made computer project is never going to come near to a modern (or unmodern for that matter) PC. It won’t even be as functional or as powerful as a little single board computer or microcontroller of today. You might well say it’s a pointless exercise then. Why go to the trouble to make something that isn’t even as useful as the cheapest throwaway microcontroller?
I blame nostalgia. Yes, it might not be as useful as a Pi Zero or even an ATmega AVR but that is somewhat missing the point. It will be a bare metal learning exercise into building a computer in the same mold of those early machines. A real computer with RAM and ROM that I can directly program and maybe even get to play a game or two. And who knows, it might even be fun.
There was only every going to be two choices here for me, the Zilog Z80 or the MOS 6502? Despite my first ever computer being a Z80 powered Sinclair ZX81. For me the CPU of choice has to be the 6502. I cut my teeth on this, spending warm summer days indoors attempting to learn 6502 assembly on a much loved BBC Micro model B. So for nostalgic reasons alone, and as nostalgia is the primary ingredient in this project, the 6502 wins. Let’s not forget it’s the CPU behind a range of legendary early computers and used in Woz’s hand built Apple 1 and, a favourite of mine, the Acorn Atom. Both of those machines are very much the inspiration for this project.
It turns out the 6502 is quite a good choice as there’s lots of information out there and I’m going to need lots of information. A modern variant is still being manufactured to this day so it’s pretty easy to get hold of.
Connecting it up
Pins 1 and 21 to ground and 5V to pin 8 will power the 6502.
Note the capacitor on the 5V. This decoupling cap helps to provide a consistent supply, especially necessary for digital ICs. See this, [http://www.vagrearg.org/content/decoupling] in-depth explanation on why these are important. My novice understanding, and therefore probably wrong, is that these iron out any power inconsistencies and almost separate/decouple the IC from any power draws on the rest of the circuit. I’ll be providing a 0.1 ?F cap near to the positive pin of all ICs and I’ll be sprinkling them around the 5V rail just to be safe.
Pins 2, 4 and 6 need to be tied high through 3K pull-up resistors as does pin 38, Set Overflow and, on the WDC 65C02 pin 36, Bus Enable.
To get things going the CPU requires a low signal on pin 40, reset. This simply means connecting the pin briefly to ground. A push button should do, although ideally the button would be properly debounced. A better method would be to use a reset IC to automatically pulse a low reset signal to the CPU on power on. For now, simply tieing pin 40 high through a 3K pull-up resistor with a push button to ground should do. It might not provide a clean reset but it should work, most of the time.
That’s the bare basics. Missing the all important clock signal input on pin 37 and with the data and address bus unconnected, it’s doing absolutely nothing!
Next time I’ll connect a clock signal and look at the address bus. Maybe it’ll do something?
More homebrew 6502
Part 1 : 8-bit Nostalgia and powering up the 6502
Part 2 : It lives! Adding a temporary clock and the free run
Part 3 : Memory map, address decoding and adding a ROM
Part 4 : Building an EEPROM programmer
3 thoughts on “Homebrew 6502: Part 1”
Where’s Part 3? 🙂
Part 3 is down, the best post I found on the subject