Category Archives: Z-80

Z-80 Homebrew MkII

I need to come up with a good name for this project… Anyhow, after my previous prototype I have decided to built a Z-80 project anew. Basically, the issue with the previous was lack of UART (I built one, had it working, then accidentally blew it up), the different boards and the masses of wires making the computer unstable and legs of my flash ROM getting bent from too much insertion and removal.

Therefore, this one will all be on the same board, have custom sockets for expansion and a built in UART. I will also add a ZIF socket to handle my ROM issues.

Furthermore, I plan to add some paging to the memory, so that I can page the ROM in and out; but this isn’t finalised yet.

All I have done so far is build a power supply to regulate the output from a transformer down to the 5V needed for the CMOS logic, but you need to start somewhere…

Start of a new computer, just a 7805 regulator.
Start of a new computer, just a 7805 regulator.

It’s alive! Z-80 Computer hardware now complete.

I have just finished assembling the memory board of my Z-80 homebrew project. All components individually tested, I placed the test program on the ROM, inserted the Z-80 and it worked first time!

It's Alive: Z-80 Homebrew
It’s Alive: Z-80 Homebrew

There is still a little more to do on modifying the I/O board to run the monitor program (which also needs writing) as the board was designed to test the various different circuits. However, the computer successfully executes the following test routine:

;COMPUTER TEST ROUTINE
;
;OUTPUTS ON PORT 0 ANY INPUT ON PORT 0 WHILST CALLING AN EMPTY SUBROUTINE
;
;

LD SP,9000H

L1: IN A,(00H)
CALL TEST
OUT (00H),A
JP L1
TEST RET

This outputs on port 0 any input on port 0 whilst using the stack pointer to save the value of the program counter in the RAM for the execution of an empty subroutine. Thus the I/O, ROM and RAM are all tested. Monitor listing to come soon no doubt.

Z-80 Update

Z-80
Z-80 home brew board
Progress on Memory Board
Progress on Memory Board

Unfortunately, it has been a long time since I could work on my  Z-80 homebrew; it has been in storage for many months. However, my setup is active once more and I have built the processor board. It consists of a power supply, clock, reset logic and buffers for the data, address and control busses. Unlike the I/O board, whose schematic is only in my head, I have used KiCad to design the circuitry and I will upload that separately.

On a separate board lives the I/O decoding and memory, on which I’ve made a start (see picture above). It’s all designed for easy testing and expansion, hence all the chips are socketed. I’ll update soon with the schematics and pictures of the finished article!

 

Z-80 Homebrew: I/O board!

The next step on my Z-80 journey is building the I/O. I decided to do this before building the processor circuit itself as it doubles up as a handy test device.

Z-80 I/O
Z-80 I/O

There are three output ports that use TIL311 displays; I got these cheap off eBay from Hong Kong. They take a four-bit input and display it as a hexadecimal value. Therefore, in pairs, they can display binary data from the data bus as a hexadecimal number 00h – FFh. They aren’t all connected to the data bus; I’ve kept them separate, so if necessary I can connect them to the address and data bus and for troubleshooting my ROM programmer.

The keypad follows¬†Ciarcia’s design, but modified to use available components. Basically, there is a 556 timer (lower right chip) that has an astable oscillator providing a clock signal of approx. 3kHz. It goes through a NAND gate (upper left) before driving a binary counter (middle right). The counter outputs a four-bit number to a 4 to 14 demultiplexer (lower left). The 16 outputs are connected to the 16 numerical inputs, which are labelled using handwritten stickers to add to the homebrew feel. When one of these is pressed a monostable timer sends a 10ms signal (longer if the switch is held). First, this debounces the switch; second it stops, via the NAND gate, the clock signal. The four-bit number outputting from the counter is then held at the number pressed, which corresponds to the value of the button, and the four bit number is present at the bus buffer (top right) to be read by the CPU. When the CPU is looking for a value from the keypad it will read this buffer and get the number from the lower four bits. The next three bits are the modifier keys and finally bit 7 is the output from the monostable timer that tells the CPU that a key has been pressed and a value can be read. A software flag will ensure that the value is only read once.

ROM is necessary to boot the computer. Gone, however, are the days of needing EEPROM or UV erasable chips and their expensive programmers. Instead a few pounds will by a 4Mbit CMOS flash chip. So to program this chip, which can be done quickly using a single 5V supply, a simple Arduino sketch is required that uses shift registers to provide a parallel output. This is currently underway and it is possible to debug it using the I/O board.

Shift Register Test
Shift Register Test Using Z-80 I/O

Here, three shift registers are connected to the Arduino providing 8 bytes of output. The top two will drive the address bus and the lower provide the data. For now, though, it is just a proof of concept and is running a simple counter. Eventually, it will be possible to program it using data sent over the serial port of the computer.