One of my hobbies is writing Z80 assembly code. It doesn't has to be very useful, but sometimes it turns out to be. Another hobby is to make tools that handle the boring parts of getting the code to run. An example of the latter is the ROMEmu that bridges the Hex-Intel files to the ROM on the Z80 board. It uses an Arduino to interpret the Hex-Intel data and writes it to a static RAM. The RAM, or part of it is visible in the Z80 memory space. An adapter interfaces the RAM pins to a socket for a RAM or ROM on the board.
Assuming a monitor is available on the board, it is possible to run and maybe debug the uploaded code. As I use a Microprofessor MPF-Ib, this works very well.
Another tool I created is the Z80Exer, to test and debug boards on which the processor will not run. It is also based on an Arduino, which is can exercise the Z80 signals. It can also perform read and write operations on both memory and I/O space. It is attached to the system through the Z80 CPU socket, so no processor is in the system.
It took quite a while that a combination of both applications could work in a live Z80 system, provided the Z80 CPU BUSREQ*/BUSAK* system is available. This is the whole bus access system. If the Z80 is running its monitor it is passive. If a line of Hex-Intel is received, it asserts BUSREQ* and waits for BUSAK*. An asserted BUSAK* means the data- and address-lines and the control lines (RD*, WR*, MEMRQ*, IORQ*) of the processor are tri-stated. This allows the Bus access board to write data to anywhere in the address map. When all data is written, the Arduino controls are tri-stated and BUSREQ* de-asserted. The Z80 CPU continues where it was interrupted. For non-time critical programs this works very well. It is not tested on dynamic RAM based systems, but a refresh system can be added if the interruptions are longer than the refresh-interval.
The MPF-Ib P1 bus is a one-to-one match of the Z80 CPU pinout. Here a connector duplicator adapter is on the P1 connector, to allow the extension chain to be used, next to the BusAccess.
The current implementation of the Bus access is an Arduino Mega 2560, as it has more than enough pins. But it is quite bulky. An smaller board is being developed, but the planned pin-extenders (MCP23S17) chips are getting scarce and expensive, so that is more a long term project. The Arduino Mega clones however are cheap and the shield simple. And the same board can be used as Z80Exer.
For oplading Hex-Intel files, a small python3 script is used, the same as for the ROMEmu.
For other Z80 based systems, an adapter board for the Z80 CPU socket is made.
Last update: 2022-05-12