Saturday, 12 October 2013

Z80 CP/M Single Board Computer

Following on from the Z80 Single Board Computer I previously built, I've now turned this into a computer which can run CP/M. This was a popular alternative (and predecessor) to DOS in the early 1980's. It ran on most Z80 or 8080 based computers, many of the multiple board S100 backplane type systems from the late 1970's / early 1980's, such as the Altair 8080 and the RML 380Z. Some home computers of the day had add ons which allowed them to run CP/M, such as the Torch BBC Z80 second processor.
Later ones could run it natively (the Commodore 128, the Amstrad CPC 6128). Much software was written for CP/M, but it lost in the end probably due to the graphics capabilities and standardisation of the IBM PC. Display support in CP/M was a bit patchy as it seems every machine had a different display with different capabilities, so there were often multiple variants of the software for different feature sets. They also had various disk formats and so again, multiple versions may be required. DOS had clearly defined MDA and CGA displays, and disk formats (see here for everything you ever wanted to know about disk drives - but were afraid to ask), so was easier to support.
Huge thanks here to Grant Searle, for his CP/M on breadboard page, upon which this is based. He has put a lot of work into that and provided clear instructions and all software required to get up and running.
The starting point was the original Z80 SBC I built previous. The top half of the breaboard remains basically the same with ROM, RAM and CPU. The EPROM is different, with Grant's CP/M BIOS and ROM BASIC. The ROM is larger (16K as opposed to the 8K on the plain BASIC SBC), so has an additional address line - which I had forgotten and it took me quite a while to realise that. Beneath, the 6850 UART is removed, to be replaced by a Z80 SIO. However, the new SBC also has disk storage in the form of a compact flash card, and the advice is keep the cables short, so that has been placed there, close to the Z80 CPU.
The clock remains (although using different gates) and there is fuller address decoding with a 74138 giving 8 I/O blocks. The serial IO is provided by a Z80 SIO/0 chip, giving two serial ports. One is used to connect to the PC via an FTDI serial cable, the other is connected to the TV and keyboard interface as before.
When initially fired up, the flash card is blank, so ROM BASIC is available, and it runs as the previous Z80 SBC. When connected up to a PC serial terminal, you can setup the CP/M system on the CF card, and then transfer software over. Grant has provided quite a neat mechanism for doing this, with a PC application which generates a text file with the software converted into hex codes, and software which sites on the CP/M side which reassembles the hex into applications, ready to run. One of the first things I tried was Richard Russel's BBC BASIC for CP/M.
The next step is to build this up onto a board, just waiting for a few parts.