Page 151 of 229 Start Back Next End ZBasic Language Reference 141 ZBasic Microcontrollers at 115.2K baud (checked). If you are using a serial channel that does not support dynamically changing the baud rate, you should uncheck the latter checkbox. On the ZBasic device side, enabling downloading by way of the ATN character can be accomplished in one of two ways. The simplest way is to use the directive Option AtnChar in the first module of your program. Once your program is compiled and downloaded (which, by the way, must be initially accomplished using the traditional DTR-based method), when the device receives the designated ATN character it will automatically invoke the command mode. The second method, which should rarely be needed, is to add code to your application to detect the specified ATN character. When the ATN character is received, your code should invoke the ZBasic System Library subroutine ZXCmdMode() either with no parameter or with a parameter value of False. It is important to note that the “Port Speed” setting in the “Execution Options” group box must be set to match the baud rate of the Com1 serial channel of the ZBasic device. The default Com1 speed is 19.2K baud but the speed can be changed using the directive Option Com1Speed in the first module of your program. 9.9 Updating Device Firmware The VM-mode ZX devices have firmware that is designed to be field-upgradeable. This allows the control program to be updated with newer versions as enhancements are made and problems are fixed. An update can be installed in a VM-mode ZX using the “Device Options...” entry on the Options menu. This will bring up a dialog that will allow you to navigate to and select the specially formatted firmware update file (typically with .zvm extension). Prior to using the file’s contents to update the ZX firmware, the file is checked to ensure that it contains a valid update image. Note, particularly, that separate update files are provided for each ZX model. You must be certain that you use the correct update file for the ZX device being updated. The filenames of the update files indicate the target ZX device and the firmware version number. Additionally, the first few lines of the update file contain the same information. The update files are standard text files and may be viewed by any text file viewer. To perform a normal firmware update the ZX must be powered up and must be connected to your PC by a serial cable. On the 24-pin ZX devices, during the update process the red LED will be illuminated continuously and the green LED will blink at a rate of about twice per second. Note that since the LEDs are also connected to pins 25 and 26, if you have circuitry connected to those pins that would be adversely affected by the LEDs being activated you will want to turn off the check box labeled “Provide visual feedback during update”. On the other ZX devices no I/O pins are used to indicate that a firmware update is in progress. 9.10 Setting the Debug Output Limit By default, the debug window will only retain the last 100 lines of output. You can change this by selecting the “Open User Options File” entry from the Options menu. This will display the current contents, if any, of the User Options File. If one does not exist you may insert a line like the one below. debug.line.limit=250 This will change the limit to 250 lines. The IDE will need to be exited and restarted after manually modifying the User Options File in this manner in order for the change to take effect. 9.11 Other Configurable Items There are many aspects of the editor that may be configured. However, discussion of the means of making such changes and the impact of the changes is beyond the scope of this document. Those interested in investigating this topic further are directed to the “ZBasic Help” entry on the Help menu.