Z80 Microcomputer Project

Click Here for the Z80 Microcomputer gallery

I've always been interested in computers and electronics in general, but I felt the need to learn how computers work down to the 1's and 0's and machine language. I started surfing the internet and found a few sites that have project plans on how to build a 8-bit microcomputer from scratch. This is something that you could of made in the late 1970's. In september 2008, I contacted Don Stewart, who helped me get the confidence to build one myself (thanks again for all your help!). After a few emails back and forth, I started to make plans on how to build a Z80 computer similar to his. In early november, I ordered all of the parts from Jameco and started building. In late november, I got the computer to run its first program!

My Z80 microcomputer is hand wired using the wire-wrap prototyping technique. This method uses thin 30 gauge wire, a special wire-wrap tool, and wire-wrap sockets. The sockets have 1/2 inch long square posts, which you use the tool to wrap (or twist) the wire onto the post. As long as you have 5 or more wraps on the post for a single wire, the connection is semi-perminant. This method was used because it's easy to change connections and is faster than soldering each wire. Wire-wrapping was a popular method used in building early computers. In fact, the AGC computer used for the NASA Apollo missions were completely wire-wrapped! After I finished my computer, I went through more than 350 feet of wire!


Click here for Z80 related website links

Assembly Language

Assembly language is the programming language used to write a program for any CPU. A CPU can only be "instructed" what to do. That being said, every CPU has its own instruction set. Some are similar to one another and some are very different. To be able to write a program for a specific processor, you need to understand how the processor works and what features it has. Each instruction is represented by a mnemonic, which is like an abbreviation. Here's a simple program written with the Z80 instruction set:


;Program to add two numbers and display the answer

;Note: everything starting with a semicolon are the comments and is ignored by the assembler


IN A,(0) ;Read byte on input port 0 and store it in register A

LD B,A ;Transfer contents of register A to register B

IN A,(1) ;Read byte on input port 1 and store it in register A

ADD B ;Add contents of register A and B. Result is stored in register A

OUT (2),A ;Output byte in register A to output port 2 (which is a hexadecimal display)

JP loop1 ;Jump to loop1


An assembler is then used to convert the instruction mnemonics to the actual machine code (which is in hexadecimal, base 16) for the processor to understand. I use an assembler specifically for the Z80 called Z80 PC Assembler By Peter Hanratty. It works great and i'd like to thank Peter for his extremely useful assembler.


My Z80 Microcomputer specs:

-Z80 8-Bit CPU running at 2.0Mhz. It processes around 400,000 instructions per second.

-32Kb ROM

-32Kb SRAM

-Various TTL logic ICs 74LSxxx series. This includes AND, OR, NOT gates, decoders, and latches.

-Hexadecimal Keypad

-Led Display Board for Debugging the Hardware

-RS-232 serial port

-A Eprom chip programmer later added on


Manual EEPROM Programmer

I originally had to hand program the eeprom using this programmer when I first built the computer. First, a chip is inserted into the ZIF (zero insertion force) socket. Then the address and data is set on the switches. Finally, a switched is flipped to program a byte. The two empty sockets are for the hexadecimal displays, they are not needed for operation. Note: for this programmer, I used an eeprom which is the electronically erasable version of the UV eprom.


Led Display Board

This display board was used to debug the hardware when I first finished the computer. It is not needed to operate the computer. However, it's cool to see the blinking lights when the computer is running on a slow clock.


Here's an example of how to operate my Z80 microcomputer:

Let's say I wanted to transfer a digital clock program to the Z80 computer's ram from the PC via the serial port. Then run the digital clock program.

1. The computer is pulled out of reset and the CPU automatically starts at address 0000h, looking for it's first instruction.

2. A jump is made to a small program that reads the address on input ports 0 and 1. Then a jump is made to the address on those ports.

3. The serial PC to ram transfer program is started and waits for data (in hexadecimal) from the PC. When data is received, it is transferred into the ram starting at address 8000h.

4. When the whole program is finished transferring, which only takes a few seconds, the CPU is placed in reset and the starting address is set to 8000h (10000000 00000000 in binary) on input ports 0 and 1.

5. The CPU is taken out of reset and a jump is made to address 8000h (the start of the clock program just transferred).

6. The digital clock program is started. It waits for the time to be entered in using the hexadecimal keypad.

7. After the time is set, the clock starts. The time is displayed on the hex displays on output ports 2, 3, and 4.

8. The time is very accurate thanks to a temperature compensated crystal (TXCO). The crystal oscillates at 32768 Hz (32,768 cycles per second). That frequency is divided (with a divider chip) by 8 to output 4096 Hz. The new frequency is divided by 4096 by the CPU to increment the clock 1Hz or one time per second. The TXCO is rated to be accurate within one minute per year.

9. That's basically it. Of course, many different programs can be created to do different things.

I've also added on an eprom programmer to program UV erasible memory chips specifically for the N8VEM single board computer project. I was also able to copy the firmware from the eprom in the 2247A scope. Eprom stands for Erasible Programmable Read Only Memory which means that the data can be programmed once, and then can only be erased by using a shortwave UV lamp. Eproms have a quartz window that exposes the die to light. An eprom is programmed by sending the data to be programmed via the serial port to the z80 computer. It can take up to 35 minutes to fully program a 1Mb eprom. Luckily, I usually don't have to program a full 1Mb so programming time is usually around 15 minutes for 512Kb. The programming speed is limited by the baud rate of the UART.


Z80 computer running the digital clock program.

Click Here for the Z80 Microcomputer gallery



Here is a picture of the eproms. The left most chip holds up to 32Kb and the rest are 1Mb. The 1Mb chips are used for the N8VEM single board computer.


I also have a few vintage eproms from 1980 and 1976! Starting from left to right: Texas instruments 2Kb 1980, Texas instruments 2Kb 1980 in a purple ceramic package with gold pins, and an Intel 256 bytes in a white ceramic package with gold pins made in 1976! The purple Texas Instruments and the Intel chips still work!


Contact: Tai Oliphant

Copyright © Tai Oliphant 2009