153 of 208
ZBasic Language Reference 145 ZX Microcontroller Family Chapter 9 - Downloader Utility Included as part of the ZBasic package is a standalone command line utility that can download code to the ZX. 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. -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<period>:<duty> Specify the period and duty cycle of the DTR 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. -u Download a specially formatted file to update the control program of the ZX. See Section 9.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 9.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 Download the file test.zxb using the default COM port, go to monitor mode until character code 8 is received. zload –s0x08 –m test.zxb Download using the ATN character &H14 at 57.6K baud on COM2, constant speed (no speed change). zload –c2:57600 –A0x14