I was raised in an eight-bit era. My first computer was a Sinclair Spectrum, but I hated the dead-flesh keys and the clumsy method of editing Basic programs. So I upgraded quickly to a BBC Micro (first B, then Master).
But while I cut my teeth on Z80- and 6502-based micros, there’s lots I missed out on – stuff I didn’t get to experience even though there was a lot of it about back then.
One of those things was CP/M. It preceded my entry into the world of computing (Oscar Vermeulen has a nice introduction to CP/M here). It came out in the late 1970s, whereas I succumbed to the lure of programming in the early 80s. So CP/M-based machines were common, and I often perused adverts in Personal Computing World (for which I would later write) with some degree of curiosity. But they were too expensive for my limited funds. And, to be honest, they already seemed old-fashioned. By the time I was pounding keys, in 1982, MS-DOS was already showing signs that it would kill off CP/M.
Still, that curiosity never quite went away. And now that I’ve caught the retro-computing bug, I figured it was time I got myself a CP/M machine.
Yes, there are emulators around, and I could have run a virtual machine (indeed, I have a CP/M-86 VM sort-of running under VirtualBox). But that doesn’t give you the real experience, does it?
Then I discovered Grant Searle’s CP/M on FPGA project. This is an extension of an earlier project, creating a Z80-based machine with almost everything, except external RAM, recreated using a low-cost (as in $24) FPGA development board using the Altera Cyclone II chip.
As I have a weakness for such devices (from where I sit, I can point to seven Raspberry Pi computers, some inside completed projects, three BeagleBones and countless Arduinos), I knew I would have to do this.
I was encouraged by a blog post by Oscar Vermeulen in which he made it sound as though the project could be slapped together in a evening of casual soldering and plugging. Actually, although Oscar’s skills are far greater than my own, he wasn’t far wrong. (By the way, check out Oscar’s post for details of the parts you need. The one component he doesn’t cover – probably because he had it lying around – is the SRAM. I got my AS6C1008 chip from Farnell.)
There followed a two-week wait while the bits made their way to me from China (and one, the PS/2 connector I finally used, from Israel – what a global village we live in).
Putting it all together was simple, but involves great care to ensure that the connections are correct. It’s useful to have lots of female-female jumper cables to hand.
I put the SRAM chip on some stripboard along with headers and associated resistors for both the VGA output and keyboard connector. I also added +5V power connectors which then power the FPGA board. So the computer is essentially two boards, plus a separate SD card breakout board, which I eventually mounted so the cards can be swapped from outside the case (like a disk drive) and the serial connector, which I put on a small bit of stripboard for ease of positioning in the case.
So long as you follow along carefully, setting up the VHDL software for the FPGA is also a doddle. Indeed, the toughest part of the whole project was getting the Quartus II software to install. For some inexplicable reason, I had lots of download and install failures. And working out how to get a (free) licence key wasn’t as obvious as it might be. I also don’t much care for working in Windows (it’s Mac and Linux for me, usually), but that’s the only option you get with Quartus. I’ll also echo Grant Searle’s warning – if you try this, make sure to use version 13.1 of Quartus – later versions don’t support the Altera Cyclone II FPGA.
I opted for the version with VGA and a PS/2 keyboard connector. An old Dell keyboard I had lying around (which had nearly been skipped) worked fine, even at the 3.3V logic levels. Now, though, I’m using a USB compact keyboard via an adaptor. Having a real keyboard and outputting to a real screen is somehow more satisfying and ‘retro’ than using my laptop as a terminal.
I also chose to use Oscar Vermeulen’s CP/M disk image, burned to an SD card (given it’s a 128K image, it’s somewhat wastefully on a 1GB card, but that’s the smallest I have and finding small-capacity cards on eBay isn’t easy or as cheap as you’d think).
And it works great. Within minutes of switching on and after I’d finally remembered how to use the USER command in CP/M I was happily playing Zork and coding in Turbo Pascal 3.0 (ah! that brings back happy memories).
For the serial port, I decided not to use a TTL/RS-232 converter to provide a fully retro RS-232 serial port. Instead, I’ve left the connections at TTL level (with some protective resistors, as suggested by Grant Searle) for those occasions when I might want to hook up to the laptop. Searle’s clever BIOS ROM image ensures that the machine will automatically use the local keyboard & screen or a remote connection across the serial port depending on the first input the machine gets.
Of course, I had to bundle all this in a suitable box – something that looked right. I added an illuminated reset switch (which doubles as a power-on light).
In case you’re wondering, I named the computer after my dog, Zola, and added ‘2000′ because, back in the 1970s/80s, using 2000 in the name of any product made it seem like stuff of the future.
Next steps might include working out how to edit the VHDL files in order to enable the cursor keys on my keyboard. As authentic as it might be, using Ctrl-E, -S, -D and -X to move around in Turbo Pascal or Wordstar gets old.
And now I have to think of something to do with it. Or do I? Maybe the whole point of this is the experience of making it. And that lovely nostalgic feeling you get when you see the words: “You are standing in an open field, west of a white house…”.