Close

New iLoad boot mode and an automated Assembler toolchain

A project log for A 4$, 4ICs, Z80 homemade computer on breadboard

No iron, no cry! Build a mini 4MHz Z80 64kB RAM system with Basic and Forth interpreters, CP/M 2.2, QP/M 2.71, Assembler and C toolchains

just4funJust4Fun 01/31/2017 at 20:367 Comments

This new IOS release (S221116_R230117_Z80.ino in the Files section) brings a new dual-boot mode. Now it's possible choose if boot with the usual Basic or use the new iLoad boot mode.
iLoad (S260117.asm in the Files section) is an Intel-Hex bootloader that allows to load from the serial port a binary program using the Intel-Hex format, and execute it. I've used a large part of the source from this site.

To select a boot mode just push the Z80-MBC Reset button and immediately after push the User button at least until the User led turns off.
The selection works as a toggle switch, and is stored in the EEPROM.
Here it is a video that shows how to switch:

Using the iLoad boot mode it's possible to automate all the process from the source to the execution in the target.
This video shows an automatic Assembler toolchain; only one command from the source assembler to the execution on the target (the source file BlinkDemo.asm used in the video is in the File section):


HOW TO SET UP AN "AUTOMATED" ASSEMBLER TOOLCHAIN

What you need to do:

  1. Set up a Windows host or a VM (Virtual Machine). I've used a Windows XP SP3 VM onto a linux host;
  2. Load the Windows driver for your serial-USB adapter. Remember that your dongle *must* have the DTR signal;
  3. Create a working directory where to store the assembler sources, the assembler program and the two batch files (A.BAT and L.BAT) in the asmbatch.zip file (see the File section). With a text editor search the line:
    "C:\Program Files\teraterm\ttermpro.exe" /c=3 /BAUD=9600 /w="Z80-MBC Terminal" /m=LoadZ80.ttl
    inside A.BAT and L.BAT and verify that both the path and the COM number (/c=3 means COM3) meet your system;
  4. Download and copy in the previous directory the TASM v3.2 assembler from here. The on-line manual is here;
  5. Download and install the "Tera Term" terminal emulation from here;
  6. Set up Tera Term. From the Tera Term "Setup" menu select "Serial port..." and configure the parameters for your COM<n> connection to your serial-USB adapter. Set 9600 Baud, 8N1, Flow control none, Transmit delay 40ms/line. Save configuration with "Save setup..." from the "Setup" menu;
  7. Copy the file LoadZ80.ttl (see Files section) in the "Tera Term" installation directory, where it is installed the main file ttermpro.exe (for a standard installation for an English Windows version should be "C:\Program Files\teraterm");
  8. Open the file LoadZ80.ttl with a text editor and go to line 10. Edit the "setdir" parameter to meet your working directory path and name created at point 3. on your system, and save the file;
  9. Open the DOS command line and go in the working directory (using the CD dos command), attach the serial-USB dongle to the Z80-MBC and for a VM "connect" the dongle to the emulated usb of your VM. All done!

Now it's time to check if it is all ok. From the DOS command line give the command: "A blinkdemo.asm" to check if all the toolchain works as in the video. To load the last compiled program give the command "L" without parameters. To load a specific intel-hex file give the command "L <filename.hex>".

Close Tera Term before every new upload.


iLoad behavior

Please remember that iLoad will take the first address of the intel-hex stream as the starting address of the program, and after the loading will jump to it.
iLoad will check the hex stream for errors, and protects itself if "someone" try to load a program (or a part) over it ("illegal address" error).

Discussions

Edgar Salgado wrote 12/05/2017 at 17:42 point

hello! I have a question... What if my serial ttl usb does not have the dtr pin? Can I still use this with a workaround? Reset when needed manually?

Thanks,

  Are you sure? yes | no

Just4Fun wrote 12/05/2017 at 18:19 point

Hi, yes it should work (but it isn't very handy...).

  Are you sure? yes | no

Stefan Nordlander wrote 03/14/2017 at 08:52 point

All this is AWESOME work! I love it. Designing my very own system based on your fantastic work. Truly appreciate it.

Regards,
/Stefan from Sweden

  Are you sure? yes | no

Just4Fun wrote 04/08/2017 at 14:20 point

Thanks a lot!

  Are you sure? yes | no

WestfW wrote 02/11/2017 at 05:05 point

the iLoad capability works really nicely.  Since I'm on a mac and don't have terraterm, I ended up copy&pasting .hex files to "minicom" (minicom is also available for linux.)   I also turned the speed up to 19200 with no problems.

  Are you sure? yes | no

Just4Fun wrote 02/11/2017 at 13:52 point

Thanks! I think it should be possible speed up the serial at 38400, because is the speed that Arduino IDE uses to upload to an Atmega32 with an 8Mhz internal osc (but I haven't tried it...)

  Are you sure? yes | no

legacy wrote 12/12/2017 at 20:04 point

copy&paste? bah ...

  Are you sure? yes | no