-
All parts of project finished!
03/08/2016 at 13:23 • 0 commentsI spent lLast few days testing and improving both ZDI interface and PC utility. After everything worked fine I moved to documenting these two parts and released source code.
So here are two links with full description: ZDI debugger/programmer and MCUload utility.
These two pages close my development, summarize user interface and contain link to download source code.
-
RAM download working reliably
03/01/2016 at 13:26 • 0 commentsAfter some time spent debugging both AVR and PC parts, download finally seems to be reliable both on Linux and Windows. I can now take HEX file compiled with Zilog's compiler, download it to eZ80 system and run it. Or I can do debugging through ZDI interface: use breakpoints, single-stepping, view changed registers or even full register set.
I will focus now on flash programming.
-
First HEX file downloaded
02/26/2016 at 19:51 • 0 commentsAfter some time, Intel-HEX download is now working. HEX file can be downloaded to RAM, verified and executed. This is good start to begin flash programming.
There is some problem in CDC driver on Windows, some data get corrupted, but on linux it works fine, so I will continue my development on linux; and I will return back to Windows later. Probably, some short delay should be added or shorter packets should be sent but it will come later.
-
extending debugger functions
02/20/2016 at 12:30 • 0 commentsDebugger interface was extended a lot. Long time has been spent on improving reset behaviour.
New debugger commands:
- AF, BC, DE, HL, PC, SP, IX, IY for faster register acces (without REG command)
- ADL, MADL, EXX commands to change these CPU's settings
- RST (renamed from RESET)
- STEP can be also executed just by pressing Enter
- MAP to print current memory mapping
Reset which results in halted CPU is quite difficult to do. It seems, that there is only short time when ZDI_BRK_CTL can be written in time enough to stop CPU with PC=0x000000. Earlier write leads to CPU completely frozen, later stops CPU at non-zero address. "Frozen" CPU means, that it doesn't do anything, is completely stopped - probably in initialization phase - and nothing else then hardware reset helps.
RST command can accept single byte parameter used to time this delay. It is possible that with another AVR compiler, this delay should be adjusted again.
Debugger interface was improved:
- disassembler prints instruction pointed to by PC register
- after instruction is executed, changed registers are printed
Here is an example of single-stepping:
000000: DI 000001: RSMIX 000003: JP.LIL $028C HL =B7E3AD IX =B7FF4A 00028C: LD A,$FF AF =0000FF 00028E: OUT0 ($9B),A 000291: OUT0 ($9F),A 000294: OUT0 ($A3),A 000297: LD A,$00 AF =000000 000299: OUT0 ($9C),A
To finish debugger, breakpoint support has to be added. -
eZ80 compiler
02/03/2016 at 09:01 • 0 commentsJust short word about compiler/linker...
When I tried to restart my work with eZ80 CPU, I had to think how to produce HEX files on linux.
After I realized that Zilog's toolchain is now downloadable for free, I tried if commpiler/linker can be used standalone. I took my source for CP/M and wrote makefile. Than I moved file by file what was needed to compile my project. Here is file list:
- bin/ez80cc.exe
- bin/ez80asm.exe
- bin/ez80link.exe
- bin/p1.exe
- bin/p2.exe
- bin/p3.exe
- bin/eZ80.ini
- bin/C1ERRORS.DAT
- bin/ez80cc.con
- include/*
- lib/*
To run these tools under linux I have prepared scripts calling wine and the first three tools: compiler, assembler and linker.
Using these tools from command line is covered in ZDSII manual UM0144.
-
Introduction to ZDI interface
02/03/2016 at 08:47 • 0 commentsBasically, ZDI has simple read/write interface similar to I2C bus. Communication starts with START condition, 7-bit address is sent and read/write selector bit, 9-th bit is used as bit separator to allow change between input and output direction.
Unfortunately, I2C peripheral is not usable for this purpose.
To simplify initial debugging, ATmega8 interface is connected to UART, so it can be easily controlled from serial terminal.
Interface has two basic commands:
- ZDIW <addr> <data> [<data> ...]
- ZDIR <addr> [<count>]
These commands should be sufficient to control all future things but for manual testing/debugging other "high-level" commands were added:
- REG [<reg_name> [<value>]]
- MEMR <addr> [<count>]
- MEMW <addr> <data> [<data> ...]
- IN <port>
- OUT <port> <data>
- STOP
- RUN
- STEP
- EXEC <opcode> [<opcode2> ...]
- :<Intel-HEX format ...>
I plan to add better debugging support: setting break addresses, smart register printing (changed registers only) etc.
Now it is time to work on programming utility...