12 of 208
ZBasic Language Reference 4 ZX Microcontroller Family availability of more I/O pins. These attributes make the 40-pin ZX well-suited for advanced projects and commercial applications. See Appendix D for more detailed information on the ZX-40/ZX-40a including several suggested connection diagrams. The ZX-44, ZX-44a, ZX-44p, ZX-44n, ZX-44r and ZX-44s are 44-pin TQFP format integrated circuits that are pre-programmed with the ZX control program. Similarly, the ZX-1280 and ZX-1281 are 100-pin and 64-pin, respectively, TQFP format integrated circuits that are pre-programmed with the ZX control program. All of these devices are bare CPUs that require some additional support components. Because of their smaller size, they are well suited for larger volume applications or those that require compact size. See Appendix E for more detailed information on the ZX-44/ZX-44a including several suggested connection diagrams. See Appendix F for more detailed information on the suggested ZX-1281 circuitry and Appendix G for the ZX-1280. The ZX-328n and ZX-328l are a 28-pin DIP format integrated circuit that is programmed with the ZX native mode control program. In order to use the ZX-328n or ZX-328l you must add a few external components such as a regulated supply, a crystal and serial interface circuitry. See Appendix H for more detailed information on the ZX-328n and ZX-328l including several suggested connection diagrams. The ZX-32n and ZX-32l are a 32-pin TQFP format integrated circuit that is programmed with the ZX native mode control program. In order to use the ZX-32n or ZX-32l you must add a few external components such as a regulated supply, a crystal and serial interface circuitry. See Appendix I for more detailed information on the ZX-32n and ZX-32l including several suggested connection diagrams. The ZX-32a4 and ZX-128a1 are 44-pin TQFP and 100-pin TQFP format ATxmega integrated circuits that are programmed with the ZX native mode control program. In order to use the ZX-32a4 or ZX-128a1 you must add a few external components such as a regulated supply, a crystal and serial interface circuitry. See Appendix J and Appendix K and for more detailed information on the ZX-32a4 and ZX-128a1, respectively, including several suggested connection diagrams. Note, particularly that the ATxmega- based ZX devices run at twice the speed of most other ZX devices and operate at a maximum of 3.6 volts. It should be noted that ZBasic is a superset of NetMedia’s BasicX language, incorporating many improvements and advanced features. Many, perhaps even most, BasicX programs can be recompiled using the ZBasic compiler and the resulting code should run exactly as it would on the BX-24 microcontroller except for differences due to the fact that the ZX is twice as fast as the BX-24. See Chapter 6 for more information on compatibility issues. Some ZX devices run in “native mode” meaning that the ZBasic application is compiled to native object code for the processor. In contrast, other ZX devices contain a “virtual machine” (commonly referred to as a VM) and ZBasic applications are compiled to instruction codes that are executed by the VM. The primary advantage of the native mode devices is that the application executes faster but the disadvantage is that the resulting program is generally larger than the corresponding VM mode program. Some ZX devices mentioned in this manual have an "e" or “u” suffix, e.g. ZX-24pe, ZX-24nu. These “extended” devices are produced by Oak Micros under license from Elba Corp. and are available in both VM and native mode versions. 1.3 Conventions In this manual, specific examples of things that can appear in your ZBasic program are shown in Courier typeface as are descriptions of the syntax of program elements. Otherwise, discussion and general references to program elements will be shown in Arial typeface. When describing the syntax of a ZBasic language element, sometimes portions of it are optional. This fact is indicated by enclosing the optional portion with left and right square brackets. Literal elements, those that must appear as typed (but without regard to alphabetic case, of course) appear as themselves. Often, it is useful to describe an element generally rather than giving a specific instance. When this is done, the description will be italicized and enclosed with left and right angle brackets and subsequent text will describe the characteristics of the generalized item.