Close
0%
0%

Z80 ICE

To facilitate debugging at a low hardware level I made this adapter that turns a STM32F407ZGT6 development board into a Z80 ICE.

Similar projects worth following
A Z80 ICE which consist of an adapter plugged on a common development board.

Now tested on a real platform instead of a Z80, works fine!

The software currently can do low level tests and work as a debugger

  • Toggle control, address and data lines
  • Generate fetch/refresh, memory access, IO access and interrupt acknowledge bus cycles.
  • On the target memory , it can move blocks, fill blocks, edit memory and load Intel Hex file (with some limitations)
  • Direct IO access (input or output bytes) on the fly
  • Binary editor on the target memory (commands are a bit awkward and non-intuitive)

The project is pretty much completed, it still needs some work to solve the problems mentioned above.

It works with Teraterm on Windows but there are some quirks. Teraterm doesn't support the escape sequences that I use to clear screen. Sending text files doesn't work with the load Intel hex function.
On linux, we can send Intel hex files with pv.

    pv -L 800 myfile.hex ­> /dev/ttyUSB0

Z80-2025-06-20.tar.bz2

x-bzip - 9.32 MB - 06/21/2025 at 09:32

Download

Capture d’écran de 2022-12-03 07-40-14.png

Portable Network Graphics (PNG) - 177.38 kB - 12/16/2022 at 09:35

Preview

Capture d’écran de 2022-12-11 21-43-39.png

Portable Network Graphics (PNG) - 47.16 kB - 12/16/2022 at 09:34

Preview

Capture d’écran de 2022-12-13 01-17-55.png

Portable Network Graphics (PNG) - 34.27 kB - 12/16/2022 at 09:34

Preview

Capture d’écran de 2022-12-08 04-34-47.png

Portable Network Graphics (PNG) - 119.54 kB - 12/08/2022 at 09:42

Preview

View all 12 files

  • On board USB UART not working?

    Jacques Pelletier12/05/2025 at 19:03 0 comments

    I had problems with the USB UART (CH340G). It frequently disconnected under Linux.

    I just looked into this these past weeks. It turned out that the USB connector became flaky and that was the cause for the frequent disconnects. I also suspected the chip wasn't supported, but a loopback test worked fine with minicom (while the connection lasted). So linux supports the CH340G.

  • binary editor improvements

    Jacques Pelletier06/21/2025 at 09:27 0 comments

    The binary editor was a bit awkward to use. I simplified this and added the terminal's arrow keys to move around.

    How to use: 

    like shown in the photos, the STM32F407GT6 board is plugged into a STM to Z80 adapter board.

    This board makes the connection to the serial port of the STM board and a connector is available to connect an FTDI basic or similar USB to serial converter. Open a terminal at 115200 bauds N81, and set ANSI terminal.

    There was a compilation error that was simple to correct. In Core/Src, there's a file sysmem.c. Edit it and add this include:

    #include <sys/types.h>

  • Minor fix

    Jacques Pelletier12/13/2022 at 06:23 0 comments

    A minor fix to display the status of the debugger: Step, Run or Halted.

  • Basic functionalities completed!

    Jacques Pelletier12/12/2022 at 02:38 0 comments

    I completed the debugger: it can step, run until 'RET', run until PC = address, run continuously. You can also edit the registers between steps.

    Importing symbols will be implemented later.

  • Source files available on Github

    Jacques Pelletier12/07/2022 at 16:21 0 comments
  • Suggestions and features wanted

    Jacques Pelletier12/07/2022 at 15:12 0 comments

    I'm currently writing the debugger part of the Z80 ICE. I would like to have suggestions and features that users would want.

    -step

    -step until return

    -breakpoint (step until PC = breakpoint address)

    More complex features to implement:

    support for NMI and interrupts, (being able to step in these)

    import symbol files from SDCC and Z88SDK

  • LibZ80 is working!

    Jacques Pelletier12/05/2022 at 01:37 0 comments

    I just integrated the libZ80 and it now executes Z80 code!

    I will make a easy to use debugger which can step, show disassembly, registers and stack.

    To do: import symbol files

  • Some improvements already

    Jacques Pelletier12/04/2022 at 13:17 0 comments

    Adjusted the bus cycles timing to be equivalent to those measured on a real Z80 at 4 MHz.

    Done some improvements to the binary editor, it's a bit easier to use and there's now a help on screen.

    The Intel Hex loader now works if we send bytes slowly enough. On linux, I use the command: "pv -L 10 myhexfile.hex > /dev/ttyUSB0", which transmit 10 bytes/sec.

    I will try to implement interrupt or DMA on the serial port.


View all 8 project logs

  • 1
    STM Cube IDE projects

    Extract the content of the 2 files Z80.tar.bz2 and libz80.tar.bz2 into the STM Cube IDE projects folder.
    Open the STM Cube IDE, import the 2 new projects.

    To program the STM32, you need an ST-Link v2 available at Digikey, Amazon, Ali Express, etc.
    If the computer doesn't see the ST-Link, disconnect and reconnect it on the USB port. It may not work if plugged in a USB hub.

View all instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates