ZBasic and ZX microcontrollers.
 
Powerful microcontrollers for engineers, scientists, experimenters and hobbyists.

Frequently Asked Questions

Frequently Asked Questions
Q. How do I get started using ZX microcontrollers?
A. This is a difficult question to answer in a general way because, ultimately, it depends on what you already know. If you are familiar with the basic concepts related to electronics, microcontrollers and programming you can probably just jump right in. If not, you'll probably need to buy a book or two to help fill in the areas where you're not as strong.

For an introduction to some of the central concepts you'll need, the book Physical Computing by Dan O'Sullivan and Tom Igoe may serve you well. The book gives example circuits and code for several types of microcontrollers including the BasicX-24 microcontroller. Another book to consider is BasicX and Robotics by Chris Odom. These books are particularly useful since the 24-pin ZX devices (like the ZX-24p) are pin-compatible with the BasicX-24 and ZBasic is a superset of the BasicX language.

We recommend that you get started by using one of the 24-pin ZX devices, e.g. the ZX-24p. In order to use this microcontroller, you'll need a way to power it and a way to connect it to your computer. Although you can purchase from several sources a "carrier board" (e.g. the Parallax Board of Education) that is compatible with the 24-pin ZX devices, we recommend using a solderless breadboard because, although it takes a little more work to get set up initially, it is much more flexible in the long run. Solderless breadboards are available from a variety of sources in various sizes.

Lastly, if your computer does not have a standard serial port (9-pin or 25-pin) but does have a USB port, you'll also need a USB-to-serial port converter. Note, however, that some USB-to-serial converters are too slow to be useful with the ZX microcontrollers. The converters made by Parallax and our own USB Converter are known to work well as they are based on the second generation FTDI chips.

 
Q. How can I upgrade my BasicX-24 application?
A. The 24-pin ZX devices are a drop-in replacement for the BX-24. In most cases, you'll be able to simply recompile your project using the ZBasic compiler and be up and running. In some cases, the significantly faster speed of the ZX devices will reveal a latent timing issue in your application that will need to be addressed. Also, if your application directly accesses some of the processor registers of the BX-24, you may need to modify the register name slightly since the ZX devices use a different Atmel AVR processor than does the BX-24.
 
Q. How can I upgrade my Basic Stamp, BasicAtom, or PICAXE application?
A. If you're using the 24-pin Stamp-compatible form of these devices, you should be able to drop in a 24-pin ZX device. The more difficult part will be converting existing code written in the archaic form of Basic used by these devices to the more modern dialect of BASIC implemented by ZBasic.

Another issue you'll encounter is converting the PBasic commands that you're currently using to the equivalent ZBasic language elements or ZBasic System Library routines. In some cases, there will be a direct equivalent while other cases may require several lines of code to convert different units or scale factors, adapt for timing differences, etc. Our PBasic Conversion Guide describes how to convert applications written in PBasic and similar dialects to ZBasic.

 
Q. What is the difference between VM and native mode ZX devices?
A. With VM mode devices your application code compiles to an interpreted code (sometime referred to as pcode) whereas with native mode devices your application code compiles directly to native machine code. This means that, in general, your application code will execute more slowly on a VM mode device compared to a native mode device. However, in many cases, the difference in execution speed won't be noticed because your application is communicating with external devices and the speed of that communication paces the overall application speed.

An application compiled for native mode will generally have a larger code size than when compiled for a VM device; a factor of 2:1 is perhaps typical. Moreover, a native mode application will require larger stack sizes for each of the application's tasks. An application built for a VM mode device that uses most of the device's RAM space may not be able to run on a native mode device due to the larger task stack requirement. One other difference is that for a native mode application that uses multiple tasks, you have to be more careful about how you write the code that reads and writes multi-byte variables that are shared between tasks to avoid problems arising from a task switch in the middle of reading or writing the multi-byte data.

As a broad statement, native mode devices are intended for advanced hobbyists and experienced professionals who need the extra raw speed for more sophisticated applications, need the ability to implement their own interrupt service routines, or need to incorporate assembly language or C code into their applications.

 
Q. I have two ZX devices that look the same except for having different color paint dots. What is the significance of the paint dots?
A. The paint dots distinguish between different ZX models that are otherwise nearly identical. The color for each ZX device can be found in the ZX Device Parameters table, a link to which can be found below the ZX Family diagram on the main page of the ZBasic website. The ZX Device Parameters table is available both as a webpage and as an Excel spreadsheet.

 
Copyright © 2005-2017 Elba Corp. All rights reserved.