Posts | Comments

Planet Arduino

Archive for the ‘z80’ Category

A small keyboard form factor retrocomputer with blue keys on a black background sits in front of a display and a LEGO model of the Space Shuttle. There are a number of jumper wires and a breadboard coming from an open panel on the right side of the machine.

In case you weren’t around in the 80s, or you happened to blink, you may have missed the Mattel Aquarius computer. [Nick Bild] has a soft spot in his heart for the machine though and built the Aqua cartridge to make the Aquarius into a more usable machine.

Originally equipped with a mere 4 KB of RAM and a small, rubbery keyboard, it’s not too surprising that the Aquarius only lasted five months on the market. [Nick] decided on the cartridge slot to beef up the specs of this little machine given the small number of expansion ports on the device. Adding 32 KB of RAM certainly gives it a boost, and he also designed an SD card interface called Aqua Write that connects to the Aqua cartridge for easily transferring files from a more modern machine.

The Aqua Write uses an Arduino Mega 2560 to handle moving data between the SD card and the system’s memory. This is complicated somewhat because a “PLA sits between the Z80 and data bus that XORs data with a software lock code (initialized to a random value on startup).” [Nick] gets around this by running a small program to overwrite the lock code to zero after startup.

Getting data on and off retrocomputers can certainly be a challenge. If you’re trying to get files on or off another old machine, check out this Simple Universal Modem or consider Using a Raspberry Pi as a Virtual Floppy Drive.

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.

There have been plenty of Z80 computer builds here on Hackaday, but what sets them apart is what you do with them. [Andrew] writes in with his Z80 single-board computer made from scratch, using the Arduino standard headers for its I/O. In turn, since he needed an easy way to program the flash memory which holds the software to run on the Z80, he used an Arduino Mega as a debugger, making the SBC an Arduino shield itself.

Using such a common header pinout for the Z80 computer allows it to be used with a variety of readily-available Arduino shields. This compatibility is achieved with an analog-digital converter and a 3.3 V regulator, mimicking the pins found in an Arduino Uno. The code, available on GitHub, includes an extensive explanation and walkthrough over the process in which the Mega takes over the bus from the Z80 to function as a fully-featured debugger. Programs can be loaded through embedding an assembly listing into the Mega’s sketch, or, once the debugger is up you can also upload a compiled hex file through the serial connection.

This isn’t the first time [Andrew] has been featured here, and his past projects are just as interesting. If you need to translate a Soviet-era calculator’s buttons into English, hack a metallurgical microscope or even investigate what’s that Clacking Clanking Scraping Sound, he’s the one you should call.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook