Some design aspects of a small computer system I made in 2020. It’s built around the 8-bit Z180 CPU, with 512kB RAM, 32kB ROM and a USB-serial interface.

annotated photo of the circuit board

Background

The Z180 CPU is an successor to the popular 8-bit Z80 CPU first launched in 1976. Both processors are still being made today. It incorperates a number of peripherals on the chip, while remaining (mostly) binary-compatible with its predecessor. This makes it popular with hobbyists both for the reduced part count, and also the large body of Z80 software (including the once ubiquitous CP/M Operating System) that has been produced in the last 45 years.

Some of its integrated peripherals include 2 16-bit timers, UARTs, clocked serial (CSIO), DMA controllers and more unusually for an 8-bit MPU: a memory management unit (MMU). This allows it access up to access up to 1MB of physical memory. Modern variants can also run at speeds up to 33MHz.

Design

I wanted to make the board without designing or getting a PCB manufactured, so this has influenced some of the design choices (like reduced part count). Also important factors are keeping it suitable for hand-soldering on prototype board, and the parts and tools I already had on-hand.

schematic diagram

Part Component Note
CPU Z8S18033VSC Static core and can run at either 5V (@33MHz) or 3.3V (@20MHz). I’ll design for 5V for full speed. The PLCC format/ socket can be easily through-hole soldered on prototype board.
EEPROM AT28C256 This is socketed to make it easier to test/debug and upgrade in the future
SRAM KM684000BLP-5 It was a bit difficult to find a part that was a high capacity SRAM, with 8-bit data words, running at 5V. This has 512k 8-bit words.
Glue logic 74HC138 Used to decode the ROM/RAM chip select lines
Power / USB Interface FTDI232RL module The module allows for communication with a computer acting as a terminal. We’ll also use the USB 5V supply – we shouldn’t be drawing much current.
microSD breakout   Interested to experiment if the SPI-interface is compatible with the Z180 clocked serial port (bit order will need to be reversed for sure). 5V -> 3.3V level shifted through voltage divider. Future storage?

Most of these parts were source from eBay. I should (but don’t) debounce the reset button. To start with, I’ll use a 6.144MHz crystal – it is divided by 2 internally for the CPU clock speed, which is a nice speed for debugging & testing. It also divides down to standard UART baud rates.

Memory Map

Type Address Range Logic Enable
ROM (32kB) 0x00000-0x80000 (repeats every 32kB) ~A19 AND ~MREQ
RAM (512kB) 0x80000-0x100000 A19 AND ~MREQ

Using the 74HC138 as a sort of lookup table to implement the logic (~E2 tied to 5V while E3, A1 and A2 tied to GND). A bit overkill, but gives the transitions we need:

chip select logic decode table

While we are not using any external IO devices, the internal peripherals are accessed using IO IN/OUT instructions. I believe this also drives the external ~IOREQ line – so we need to account for this in the logic to only select on valid memory read/writes.

Building

It’s not the tidiest construction, particularly the reverse-side. I’ve tried to keep the address and data buses running over the top of the board, while the power and control lines run along the underside. During wire placement, it was sometimes useful to create small wire loop guides threaded through the board. This would help guide and keep bus wires together. I used 30AWG wire-wrapping wire.

unannotated front-side photo of board unannotated under-side photo of board

There’s still some more room on the board for some extra things. Once things are up and running a bit more, would be interesting to add a real-time clock. Also an ESP8266 to the spare serial port to give WiFi access. Minimal 8-bit web server perhaps?

Booting the system

See Part 2: Booting for more on booting the system, memory layout, peripherals and writing a bootloader.

There are some nice modern systems already out there designed around the Z180 CPU:

  • YAZ180 “Yet Another Z180” computer. It’s quite feature rich, incorperating an external FPU, I2C, WiFI and CF card interfaces. It can run CP/M which is pretty nice. Also a nice custom PCB layout.

Datasheets