Close

SIO Emulation - Debugging (3)

A project log for 3-Chip Z80 Design

Combining a Z80 retro design with a modern PSoC CPU.

land-boardscomland-boards.com 10/12/2019 at 18:590 Comments

It is really, really easy to debug the I/O emulator using the PSoC debugger. I can single step through the code. With the DSLogic+ Logic analyzer I can even see the I/O instructions being sent from the Z80 one at a time. Here's one of the CPU cycles.

This corresponds to the code:

0408   01AE 3E 04       		LD	A,$04
0409   01B0 D3 02       		OUT	(SIOA_C),A

I've split up the code into Z80_IO_Handle.c and Z80_SIO_emul.c code. The Z80_IO_Handle file looks at the address of the IO and calls the appropriate code in Z80_SIO_emul file. This lets the emul code handle the pair of writes to the control register(s).

Got the I/O writes to SIO working. Here's the timing of writing the SIO_A registers:

Here is one IORQ* cycle zoomed in:

This is 2uS wide IORQ*.

Discussions