This repository documents my Z80-based "Phoenix MIDI Processor Computer" which is the successor and more refined version of my 1985-era Colossus Control Computer (1985-1987). This was the last Z80 machine I designed and built, and the nicest visually looking.
The presented material can be useful as a teaching aid for:
- Learning how to integrate low-level Z80 assembler code along with Aztec C high-level code, all within a static ROM.
- Learning how to design and build a MIDI-centric data processing system, including the usage of its well tested interrupt and queue driven MIDI/RS-232 buffering mechanisms.
- Learning how to write real time MIDI processing C-code routines supported by a lower level Z80 framework.
- Learning how to use a LCD interface & keypad for restricted user interface interactions.
The full intent and focus of this custom computer was to act as a "MIDI stream processor" which has these basic processing capabilities (written in Aztec C code):
- Real time MIDI data analyzer with filtering
- Display active MIDI channels
- Display highest and lowest notes of each MIDI channel
- Casio CZ-series patch librarian
- Roland TR-707 drum machine patch librarian
- Yamaha Tx-81Z patch librarian
- Host controller for the MIDI drum pads interface.
- Ymodem/Xmodem upload/download support for the Synth patches.
A separate tutorial has been broken out which explains how to build the numeric keypad with its animated 'Cylon Eye':
- Z80A 8-bit processor running at 4Mhz.
- Z80 SIO (serial I/O). Port A = RS-232 or MIDI, Port B = MIDI with MIDI to MIDI pass-through mode
- Z80 PIO (parallel I/O)
- 8253 programmable timer (for RS-232 baud rate + LED 'Cylon Eye' animation speed)
- 8k of static memory (6264)
- 32k of EPROM memory (27256)
- 256k of 62256 battery backed up static memory (in 16 banks of 16k) for the Synth patch banks
- 2 line, 40-position Hitachi HD44780 LCD display
- Custom 3x8 matrix numeric keypad
- 'Cylon eye' animated LED display
- One synth MIDI in port, two synth MIDI out ports and one computer MIDI in/out port
- Each MIDI in port can be programmed for "thru" mode to connect directly to their output ports
- One RS-232 DTE serial port for computer communications (which can be re-routed to MIDI)
- A dual set of normally-open and normally-closed foot switch inputs (Yamaha and Roland)
- Expansion support for the MIDI drum pads
- "All notes off" front panel push button which creates a Z80 non-maskable interrupt
- A "beep maker" via a 2N2222 transistor and small speaker
Communication is provided to two synthesizers ('Synth MIDI Out 1 & 2') and to the host MIDI computer/sequencer. However, the Z80 SIO (serial I/O chip) only has two serial channels but three are needed. Since the RS-232 port is only used to backup synth patch info to the host computer, the RS-232 serial port is switched out and that channel used to talk to the host MIDI computer/sequencer. Also the 'Synthesizer MIDI' and the 'Computer MIDI' ports can bypass the Z80 processor (and its 2ms delay) by going into 'thru' mode, such as if you want to route a source MIDI keyboard (attached to the 'Synth MIDI In' port) to one of the Synth MIDI Out ports (the latter which might host a drum machine or synthesizer). These last two features are handled by the 'multi-way multiplexor MIDI/serial hardware logic'.
Z80 pure assembler code:
| Filename | Description |
|---|---|
| pmon.mac | The main Z80 monitor and support routines |
| pmonlib.mac | C Bindings to the low level assembler routines |
| lcd2.mac | Low level driver for the 40x2 HD44780 LCD panel |
| xmodem.mac | Xmodem send/receive routines |
| czdata.mac | Conversion arrays for the CZ-Android file converter |
| drumpad.mac | MIDI drum pad code |
| keytbls.mac | Keypad encoding tables and values |
| crctbl.mac | Pre-computed CRC table |
| publics2.mac | Public definitions for pmon.mac |
C-Code and header files for the Aztec 1.06D compiler:
| Filename | Description |
|---|---|
| pmain.c | Mainline C code applications |
| control.c | LCD user interface to the common patch to synth downloader |
| czconv.c | CZ-Android to Casio Synth file format converter |
| czsend.c | Casio CZ synth transfer routines |
| midianalyzer.c | Midi data analyzer |
| roland.c | Roland TR-707/TR-727 drum machine transfer routines |
| txsend.c | Yamaha Tx81Z send routines |
| ymodem.c | YModem protcol by Chuck Forsberg |
| Filename | Description |
|---|---|
| keytbls.h | Keypad encoding equates |
| lcd.h | LCD equates |
| patch.h | Synth patch related equates |
| pmonlib.h | Include file for access to ROM routine bindings |
| sramaddr.h | SRAM memory layout |
All of the .mac, .asm and .c files can be compiled together via 'sub compile'. This assumes that the Aztec C v1.06D compiler has been mounted as CP/M Drive D.
And the files are linked into the final "pmon" 32k ROM image via 'sub link-p'.
Memory map:
c000-ffff 256k of battery backed up banked static RAM (16 banks * 16k)
a000-bfff Image of 8k static RAM of 8000-9fff (undecoded)
9ff0-9fff Special monitor jump table
9fd0-9fef CTC, PIO, NMI, SIO interrupt vectors
9f00-9fcf Monitor and C code stack area
9d00-9eff Monitor data variables, etc
9c00-9cff 256 Byte Midi Input buffer
9b00-9bff 256 Byte RS-232/Midi Input buffer (Multiplexed SIO-A channel)
8000-9aff 8k of program static RAM (battery backed up). '_C_mem_top_' = 9affh.
0000-7fff 32k of program ROM
Notes:
'_C_mem_top_' equates is top of useable RAM by C code.
'_dseg_end_' is bottom + 1 of useable RAM by C code.
Source code listing, summer 1987:








, Hitachi HD44780.webp)



.webp)
.webp)












