A Z80 Board With Very Few Parts

The Z80 is one of those old CPUs that is both obtainable and easy to work with — at least in some versions. [Doctor Volt] put together what may be the simplest possible setups to get a working Z80 system. He has the processor, of course. But everything else — clock, memory, and power — are from an Arduino Mega 2560. You could argue that’s two chips, but the board actually has several chips on it. On the other hand, you could probably pull off the same stunt with a bare ATMega 2560.

We’ve seen this done before, but usually with a few more support chips. If you are a purist, [Doctor Volt] also has some Z80 and CP/M experiments where the Arduino only acts as a disk drive for the computer and there are only two support chips. There are three videos for both projects that you can see below.

We were struck by how simple the first project was, though. Around 100 lines of source code is all it takes, and some of those are comments. The Arduino even provides the system memory (1K of it) and you initialize it by changing the memory.h file and reloading the Arduino.

The code does a bit of setup for interrupts and the clock and then just spins. The Arduino gets an interrupt on a CPU read and a different interrupt on a CPU write. All memory reads draw out of the simulated 1K RAM and memory writes go there, as well. The write code also can detect an I/O port write and sends that data to the Arduino serial port. It doesn’t appear to matter what I/O port you write to.

This reminded us of one of our favorite cheap Z80 projects. That board uses an ATMega32A in a similar way but also has external RAM. If you add a few EEPROMs to act as disk drives, it sits somewhere in the middle of the two computers from [Doctor Volt]. With so few parts, it is easy to get these 8-bit wonders in fairly small spaces.

25 thoughts on “A Z80 Board With Very Few Parts

    1. So, and this is probably a dumb question, could you pull out the CPU in say a ZX81 or ZX Spectrum and “upgrade” it with the faster processor?

      I’m guessing there would be issues with other components as I think they all share the same clocksource. But in theory?

        1. I’m not sure how memory space enters into it, but yes the ZX stuff used the CPU for a lot so your video would probably be off along with keyboard scanning and anything else timing sensitive (e.g., cassette port).

          1. The onboard DRAM and ROM are the limiting factor for (slow) access time and you would need wait states added. If you want to have faster memory, they have to be *outside* of these address space so that the slow chips aren’t selected. Pretty much all “accelerator” card do that.

            The whole Zx81 is a pain in the butt, so you are much better off re-implement the whole thing in FPGA or just ditch it for some better designed hardware.

    2. Arduino tries to pretend itself as memory and other peripherals in these 2-4 chips systems. The problem you will see is that the Arduino can’t keep with feeding the faster Z80 and become the bottleneck.

      As for faster Z80, Rabbit Semconductor was making something similar, but not full binary compatible. Sadly they were acquired by digi and only selling boards and modules. I saw some 200MHz Rabbit 6000 modules on their website.

    3. But do the newer ones have the undocumented instructions? (Like treating IX/IY as 4 more 8-bit registers IXh IXl IYh IYl, or the funny shift-left-with-1.) You dealt with these slow limited processors by wringing every last trick out of them you could find. I know some of the advanced Z80 descendants didn’t: Z280 finally got a multiply and more memory, but couldn’t see a IXh or IXl.

  1. Cool, another nice post that takes me way back to those sentimental eras, thanks :-)

    Wrote quite a few programs for embedded Z80 setups including my WAIT (pre Curtin University) Ba EE project 1982 “EFI with transmission control” on a 1972 ford escort. Ie the center console held an S100 prototype board with the CPU, glue logic and a to d and and an 8 digit segment readout which also simulated the 4 cylinder engine by up/down boxes lol.
    Inputs, pump and injectors off a VW Kombi. The Z80 nmi switched out the optional onboard rom CP/M to service injector firing with AFM input in background. To load from a floppy needed to have the engine off doh. It mostly worked, well long enough to pass the engineering project unit. Financed it myself and refused the $50 subsidy as back then it assigned copyright to the department, ugh they didn’t like that one bit, threat of legal wtf.
    Btw. Exploited the 16 bit z80 parallel output mode despite it being an 8 bit bus, no one else did it and it’s not an undocumented instruction either – worked just fine, details buried in the instruction mode operation, it’s a nice trick rather unconventional decoding issue though ;-) Ask if interested :-)

    Also bought a few “Superbrains” from USA, dual z80 cpu white fibreglass desktops with b/w screens dual floppy to run Pascal mt+, basic and Osborne accounting packages for clients. Good experience, wrote sizable amount of os drivers for Winchester hard disks. Heaps of projects in data base even asked to do sizable lotto analysis for well well paying client, weird.

    Great experiences, these days can fairly easily emulate the Z80 on any CPU of last 20 years a heck of a lot faster than the 8Mhz max latest z80 though mine only ran at 4Mhz. I recall something like avocet was around that time, prob been updated a heap by now.
    Cheers

    1. > Btw. Exploited the 16 bit z80 parallel output mode despite it being an 8 bit bus, no one else did it and it’s not an undocumented instruction either – worked just fine, details buried in the instruction mode operation, it’s a nice trick rather unconventional decoding issue though ;-) Ask if interested :-)

      Yes, please more about unconventional ways

      1. G’day Bert,
        The unconventional part is only the decoding. The z80 instruction set offers the BC registers expressed as a single 16 bit wide operation on the address bus onwon some output instructions with 8bit data on the data lines.

        So if you want to do 16 bit parallel output then put the data in the BC registers with the output address on the data lines and decode that, ie swap around the decoding method. Just need to factor in the different delays from the standard output and it works fine :-)

        Not many places back then that could use comparatively high speed 16 bit out other than DACs but, of some use on waveform generation as a cheapie way eg from eprom or fft filter to BC registers to DAC, may E a dead simple custom waveform generator…

    2. Wow! This brings back memories. Building an 8085 computer was my senior project. It had 27128 eprom and 26128 static RAM. It was all wire-wrapped together and we had to write the operating system from scratch! I’m amazed that you can now download a IDE for free. Back in the late 80’s that would have cost thousands of dollars!

      1. Motorola were pretty generous with software tools in that era I believe. Though an honest to goodness “IDE” wouldn’t have helped you much unless you had a Vax in the garage.

    3. “Great experiences, these days can fairly easily emulate the Z80 on any CPU of last 20 years a heck of a lot faster than the 8Mhz max latest z80 though mine only ran at 4Mhz. I recall something like avocet was around that time, prob been updated a heap by now.”

      Probably throw in another decade, because the 90s went from 3 or 4 times as fast to 30+ times as fast emulation, and maybe another half decade because 68020 and 286 could do double speed Z80 emulation.

    4. I did a lot of cross development for the 6805 using Avocet assembler on a Quasar QDP100 with a Televideo 910 terminal. Two 8″ floppies! We thought we would never need more than those boxes.

      As for the 16-bit I/O, was that the repeated input/output instructions? Seems like I recall that.

  2. You can make a real minimalist Z80 with a Z80, a ‘138 octal decoder, a 27xx eprom, a 6116 8 bit widex2k RAM and a 8250 for the serial port and an 8255 for GPIO parallel ports access. That was sort of the standard “single board micro” in the 80s. Wirewrapped, soldered, etc. a bunch of them. You could probably ditch the 8250 and do software UART if you’ve got some code laying around for it. And you’ll need a EPROM eraser.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.