ZBasic Language Reference
163
ZBasic Microcontrollers
Chapter 11 - Downloader Utility
Included as part of the ZBasic package is a standalone command line utility that can download code to
the ZX or a generic target device with a ZBasic-compatible bootloader. Like the compiler, it is a console
application meaning that it has no graphical user interface. The invocation syntax for the downloader is:
zload [<options>] <code-file>
where <code-file> is a file containing object code created by the compiler, usually having a .zxb
extension. The code file is in an industry standard format and contains checksums to help detect
communication problems.
After the code file is downloaded, the ZX is reset so that it begins running the user program.
The available options for the downloader are described in the table below. All options are case sensitive.
For some options, an accompanying hexadecimal value can be specified using a 0x prefix.
zload Options
Option
Description
-h
Display an invocation syntax summary and then exit.
-c<port>[:<speed>]
Specify the serial port to use instead of the default port. <port> must be a
decimal value between 1 and 99. If the optional decimal <speed> value is given,
the port is opened at that baud rate; otherwise the speed is 19.2K baud.
-b<run-speed>:<dl-speed>
Specify the baud rates for run mode and download mode.
-d<family>
Specify the device family for downloading to a generic target device. The
supported families are mega, ATmega, xmega, and ATxmega.
-f<frequency>
Specify the operating frequency for a generic target device.
-v
After downloading, perform a verification pass.
-m[<log file>]
After downloading, remain connected and display any received characters on the
console. If the optional log file is specified, output received from the ZX will also
be written to the specified file.
-s[<term-char>]
Terminate the monitor mode (-m) if a character with the value specified by
<term-char> is received. The value may be specified in decimal or
hexadecimal. If not specified, the termination character is EOT (04).
-a
Enter ATN test mode. Used to verify correct connection to the ZX.
-a+
Specify that the ATN signal should idle in the high state (+V).
-ar
Specify that RTS should be use for ATN signalling.
-a<period>:<duty>
Specify the period and duty cycle of the DTR/RTS toggling for ATN. The period
is expressed in milliseconds (5 to 25) and the duty cycle in percent (1 to 99).
-a<ATN char>
Specify use of the given ATN character (decimal or hexadecimal) whose value
must be 1-31.
-A<ATN char>
Same as -a but without changing to 115.2K baud during downloading.
-i
Retrieve an identification string from the attached device.
-u
Download a specially formatted file to update the control program of the ZX. See
Section 11.1 for more details.
-U
Same as u except that no visual feedback is provided (using the LEDs on the
24-pin ZX devices) during the update.
-e
Use a special emergency update method. See Section 11.1 for more details.
-z<id>:<value>
This option is used to send configuration information to the device.
Some example invocations of zload are:
Download the file test.zxb using COM2.
zload c2 test.zxb
Download the file test.zxb using COM2 with verification.
zload c2 v test.zxb
|