# How do I build a computer with a Z80 microprocessor?

I've got the chip, so how would I add: a clock, RAM, hard drive (maybe EEPROM?), a screen (LCD graphical screen?), input method (keyboard, mouse) ?

-
What do you want to use it for? That determines your requirements. – stevenvh Mar 24 '12 at 17:56
The Z80 genuinely was a very very very wonderful processor in its day, but its day is long gone. Unless you very very very specially want to and must use a Z80, don't do so. Use something else. Put your Z80 in your own private museum as a sample of a processor that made a large difference in the path to what we have now. – Russell McMahon Mar 24 '12 at 20:19
I think you'll have a hard time finding a (cross)assembler or (cross)compiler that runs on a current PC, not to mention the peripheral chips, an EPROM and matching programmer that you require to get it running. I'd go for Arduino which has a lively community on Internet, loads of libraries for all sorts of hardware, developtment support for Linux and Windows. – jippie Mar 24 '12 at 21:41
@jippie It's not hard, but it doesn't make much sense unless you are seriously into retrocomputing. There's sdcc as a compiler and Farnell lists all the Z80 peripheral chips as available, though the prices are rather steep. – starblue Mar 24 '12 at 21:51
I have a Z80 running a darkroom timer I built in 1980. The timer still works, but it outlived my need to time exposures and chemical baths in a darkroom. It is still a working intervalometer, but I currently don't have a use for it. – Olin Lathrop Sep 21 '12 at 15:00

Don't listen to the others saying that the z80 is too old or too hard. The z80 was designed for this task. It's the oldest continually produced CPU around for a reason, it's easy to build computer systems with it. It's an excellent choice for your project.

There are some great books like "z80 microcomputer design projects" and "the z80 handbook" that will really help you out. Also, look at z80.info, they have a ton of information you'll want.

Your design goals are realistic. The hardest part will be the LCD screen, assuming you want to drive a VGA or NTSC display. But even that, once you get into it, is not that hard. That'll be a recurring theme you'll encounter in this project, things are much easier than you expected. Early microcomputers were remarkably simple machines, expecting you can duplicate them to some degree in 2012 is a very realistic goal. Aside from the custom sound and video chips, the rest of the machine is still available as off the shelf parts and easily unstandable even as a newbie.

The simplest usable z80 system will have the z80 CPU, some flash memory or EEPROM you can get for free from old motherboards, ram and a uart for serial communication (plus a max232 for level shifting). All of this is available at any electronics distributor, are through hole components and can be built on a breadboard. The only special equipment you'll need is the flash/EEPROM programmer (which I built myself from an Arduino). Oh, and a few other things like some 74 series logic chips for address decoding, reset circuit, etc and a crystal oscillator.

Alternatively, you can replace the uart with a z80 pio chip to communicate with a modern parallel mode LCD character display. It won't really do graphics, but it's easy to use and your z80 can print things early on. A ps/2 keyboard will be rather simple to interface.

But anyway, the z80 is a good choice for your project. This might sound complicated, but in the end its just not all that bad. Build incrementally, start with the z80 test circuit, wire up a EEPROM so it can run some code and just build from there.

-
The most critical part of the project will be coming up with some sort of eprom replacement to which code can easily be downloaded from a development PC; that's where things were primitive in the z80's era compared to today's microcontrollers with in-circuit-programming. Alternatively, if you get a serial bootloader validated (possibly with a bitbang SPI SD card interface "disk") and put it in an actual EPROM, you can easily use static ram for your code under development. – Chris Stratton Sep 21 '12 at 15:23

It's not exactly the best thing to do: the Z80 is a very old 8-bit microprocessor, and it won't support the LCD graphical screen and the hard drive. And it will be very hard, if possible, to make it work with the keyboard or mouse.

And for sure it's not everything you need to make a board: what do you need to do exactly?

If you want to learn about the z80 (you're about 30 years late for it) you can try one of the old developement boards; they have buttons, LED displays, input/output interfaces, and that's it basically.

But if you want to make a microcontroller-based system, try something like Arduino and start playing; it seems you don't have a clear idea about how to make a board, and a computer is out of discussion by now.

-
Keyboard and mouse should be the least of his worries if he uses serial PS/2 devices. – stevenvh Mar 24 '12 at 18:08
But as I get it, he doesn't even have a developing board, where would you find the PS\2 interfaces? And is the z80 fast enough for a mouse?? I mean, it has to move the cursor in a screen... – clabacchio Mar 24 '12 at 18:12
While the Z80 is old, the claim that it will not support a graphic LCD or hard drive is based on poor reasoning. For a z80 or any simple contemporary processor (atmega, etc) IDE hard drives are quite easy to talk to, so you could hang one downstream of an 8255, or you can bitbang spi to an SD card. z80 based computers routinely had graphic CRT's via support circuitry, LCD's are available which would accept exactly the same signal, or with built in framebuffers that could take a more abstract command interface. What the Z80 really lacks is built in self-programmable flash, UART, etc. – Chris Stratton Sep 21 '12 at 15:19
I did my z80 programming using a hex keypad. Who needs a keyboard? The OP needs to learn about memory mapped video, heh. – Tony Ennis Sep 22 '12 at 2:25

You will have a very hard time building your own "computer" based on the Z80 with all the features that you described. However, if you can live without building the hardware yourself, a Z80 computer that you program yourself is completely possible.

The old TI-83, TI-84 and similar (pre-TI-89, I believe) are Z80 based calculators. They are still very common calculators, and they can be had for around $100: http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=ti-84 The calculator features everything you want except for the mouse, and because the calculators are still common in schools, you will still find good numbers of Z80 developers. StackOverflow can help if you have questions: http://stackoverflow.com/questions/tagged/z80 I'm not sure how easy it will be to reprogram the Z80 with your own code, though. - At high school, we had a course of Assembly programming using the z80 developemebt boards; we had all the toolchain to program it with its Assembler code, to light some LEDs and display some numbers with the 7-segment displays. So I think that for a more hardware-oriented learning it could be a good starting point, but who knows where they can be found... – clabacchio Mar 25 '12 at 8:58 While there's merit in suggesting a potentially hackable development platform, the initial "very hard" claim is overblown. It's true that there will be a lot of stages of a project to do everything on the poster's list, but none of those things are particularly difficult, or out of the scope of what was commonly done by hobbyists either in the early 1980s or today. – Chris Stratton Apr 28 at 14:18 Indeed the Z-80 is an old chip, but it can be a nice challenge to build a computer with it. Unlike all modern microcontrollers it does not have many built-in features so you will have to add RAM, EPROM and address decoding hardware yourself. And this is exactly what they did many years ago when Tandy built the TRS-80. Just take a look at the original Model-1 schematics : http://electrickery.xs4all.nl/comp/trs80/doc/westHWBook.pdf -  You start to respect what hardware is integrated into chips like ATtiny and ATmega when browsing through that document. I'll probably have spontaneous nightmares just from data- and address bus wiring. – jippie Mar 24 '12 at 21:58 Apart from the Z80 itself, most of what was in the TRS-80 was due to the video section and the dynamic RAM interface. Also, the chip count was rather higher than it might have been b/c for some reason they used a lot of 16 pin 'hex' parts (e.g. 74LS367) instead of fewer, 20 pin 'octal' parts (e.g. 74LS244). My point being, you could probably clone a TRS80 rolling your own Z80. +1! – JustJeff Mar 26 '12 at 1:51 Luckily there's a book - "Build your own Z80 Computer" and although it's now out of print, the author Steve Ciarcia has generously allowed it to be distributed freely as a PDF: http://retro.hansotten.nl/index.php?page=z80-sbc You might also want to take a look at the N8VEM Home Brew Computer project. It's a Z80 SBC (single board computer) that can run CP/M and can be built very cheaply - the PCBs are$20 plus shipping. There are now a variety of expansion boards available (S100 bus!) and there is knowledgeable & helpful community behind it all.

But first of all, why not grab a handful of components and build up the minimal Z80 tester to make sure your CPU works - http://www.z80.info/z80test0.htm This just hardwire's the data and address lines to continually execute the same instruction (NOP) to demonstrate fundamentally, the heart of a working Z80 based computer.

-
 Awesome links. Now I'm even tempted to try myself ..;-) – Cees Meijer Mar 26 '12 at 12:04

There exist on the web several sites that document how to create Z80 based systems. I'm currently builing on and at the moment I have it set up with a floppy drive a serial keyboard and a VGA monitor and an SD card.

The project home :

http://n8vem-sbc.pbworks.com/w/page/44366173/Zeta%20SBC

-

The z80 is so out of date, you won't be able to build anything but a novelty retro-computer with it, but that doesn't mean it wouldn't be instructive and fun to attempt.

If I just wanted to prove I could make an old z80 run, I'd probably put it with a 32Kx8 static RAM and a UART chip, and burn a modified TRS-80 Model I ROM image into whatever small EPROM/EEPROM is lying around. The entire memory map could be decoded with an MSI chip.

It wouldn't take much s/w hacking to scrape out the TRS-80 keyboard matrix decode routines and replace them with a UART input routine, nor to find the character-out routine and replace it with a UART output routine. Then it could be hooked to a PC serial port, and the old BASIC could be brought up and interacted with.

That ought to prove you're running a z80, w/o the hassle of trying to implement much I/O for it.

-

I've had the chance to build a couple of computers from scratch based on the Z80 microprocessor, namely a Sinclair ZX80 (an improved version) and the Jupiter Ace from the company Jupiter Cantab. Both work just fine and these machines make use of a keyboard and generate black and white pictures (at a resolution of 240 x 192 pixels) onto a TV set. More information on them:

http://www.jupiter-ace.co.uk/

http://searle.hostei.com/grant/zx80/zx80.html

A successor of the ZX80, the ZX Spectrum, does not only all of this but also has all kind of interfaces like IDE disk interface, floppy disk interface, and also for more modern storage media like USB pen drives or SD cards.

My recommendation: go ahead and do it! Research, learn a lot along the way and have fun. Things are a lot easier these days than they were in the 80s, we got the internet, CPLDs, FPGAs, as much static RAM as we want, etc.!

Good luck and take care.

-