Review - The ZX-24 Microcontroller

Background

In preparing for my second High-Altitude Balloon mission, I wanted to find a microcontroller that I could use to interface with my Coastal ChipWorks TNC-X. The obvious place to begin my search was the Parallax Basic Stamp. I had seen the Parallax website a few times, and was familiar with the BS2's reputation as a low-cost and high-quality entry into microcontrollers. It also helped that so many HAB projects had used the Basic Stamp to good effect. I was cruising through Radio Shack one day and saw the Parallax BOE-Bot kit on sale, and figured that the few extra bucks I'd spend on this kit would also give me some servos, LEDs, and fresh resistors and capacitors to work with. I plunked down my $100 and headed home.

My first Basic Stamp program was the traditional "Hello, world" routine, copied from the instruction book, which worked just fine. For my second program, I wanted to read some data from a serial device, since this would be the main purpose of the uC in its role as flight computer. I started my program by defining a 256-character string variable to hold an outbound KISS-formatted APRS string. When I later compiled this program, the compiler complained that my subscript was out-of-bounds. I tried shrinking my string to 128 characters, and got the same error. 50 bytes, same error. At this point I was baffled. I checked the specs on the BS2, and found to my amazement that it only had 32 BYTES of available RAM. I further learned that it did not have any serial buffers, and that it is extremely difficult to get serial timing to work correctly, especially when receiving data from non-Stamp devices. This simply would not do. I went back to the Internet, and began my microcontroller search again.


Something Better

After a while, I came across the ZBasic website, which offerred for sale a microcontroller module called the ZX-24. The website claimed that this AVR-based uC used a superior dialect of the BASIC programming language, and provided far better performance than the BS2. Further, unlike the BS2, it offerred multi-tasking functionality within a single module, on-board analog-to-digital converters, and most importantly, a whopping 1024 bytes of RAM (don't giggle, PC guys - this really is a huge improvement, especially for a computer than is not much bigger than a quarter). As an added bonus, the ZX-24 is pin-compatible with the BS2, so I would still be able to use the excellent "Board of Education" prototyping board that came with the BOE-Bot kit. With some hesitation over spending more money on another unfamiliar product, I ordered a ZX-24 from the website, and kept my fingers crossed that the actual product would be as good as it sounded on the website.

I have now worked with the ZX-24 for a couple of weeks, and I could not be more pleased. The module has performed flawlessly at every task I have attempted, including inbound and outbound serial communications, analog-to-digital conversion for measuring battery voltage and ambient temperature, and triggering of external electrical devices. The computational performance of the module is outstanding - it can run through a complicated lat/long-to-distance formula is less than one tick of the on-board real time clock (about 2ms). With the available memory, it is very simple to define buffers for the serial lines, which eliminates serial timing as a critical programming issue (almost - as long as the buffers don't overflow). The onboard ADC is trivially easy to use, and with 10-bit precision, it provides excellent sensitivity as well. The two on-board LEDs are also a nice touch, as they do not require any external circuitry to provide visual feedback.

I must admit that the first day or so with the ZX-24 was a bit frustrating. The ZBasic programming language is strongly typed, and I do mean STRONGLY - this was quite a shock, since I have been using Perl almost exclusively for several years (Perl is very loose with variable types). One of my first programs was about 100 lines long, and took about three hours of scanning through the manuals, fixing, re-compiling, and so on before I finally got the program to compile successfully. I could have benefitted tremendously from more code samples, but eventually I managed to stumble my way through. The first day with the ZBasic IDE was not so great, either. It looks very spartan at first - not much to click on, and very little to guide you through the first few steps.

My familiarity with the language improved quickly, though, and within a couple of sessions I began to experiment with some of the more advanced features. As someone used to working with simple Unix shell scripts that run in parallel and interact with each other, I found the multi-tasking functions perfectly reasonable and easy to use.

I also came to appreciate the ZBasic IDE more as my familiarity grew. It highlights comments and keywords in different colors, offers ToolTips for the syntax of certain commands and functions, and so on. The error messages from the compiler are well-worded and easy to understand, and make it very simple to find bugs (which for me are almost always variable type issues). The tabbed pages are well-suited to assembling small proof-of-concept code snippets into a larger application - this is how I usually work, so I really enjoyed this aspect of the GUI. The use of cryptic configuration files is not for the faint of heart, and is arguably the most significant weakness of the ZBasic IDE (it took almost ten minutes for me to change the font size, for example).


Conclusions

The $60 that I reluctantly spent on the ZX-24 has turned out to have been an excellent investment. It has performed perfectly, and has been very well-suited to every process I have dreamed up for it. With features and performance that easily best those of the venerable Basic Stamp 2, and yet with the same physical format and pin configuration, the ZX-24 provides a vastly superior platform for advanced hobby applications. In fact, given its high performance, standardized platform, and minimal external parts count, the ZX-24 offers a much lower barrier to entry than most mid-market microcontrollers, especially for hand-built prototypes and small production runs. In fact, for OEM applications, the multi-tasking capabilities and powerful programming language of the ZX-24 may offer many designers a better value proposition than the $89 Javelin Stamp, Parallax's top-of-the-line, Java-based uC module, while running faster and in a broader range of operating temperatures.