Sunday, 05 July 2015
Introducing the ZBasic Microcontroller Platform Print E-mail
Wednesday, 30 November 2005
Article Index
Introducing the ZBasic Microcontroller Platform
ZBasic Architecture
Using ZBasic
ZBasic Features and Function
Example ZBasic Application

ZBasic is a new microcontroller platform based on the Atmel ATmega32 and ATmega644. This article shows where ZBasic fits in a range of microcontroller architectures and describes the features and functionality of the ZBasic platform. An example ZBasic program is provided that uses ZBasic features such as multi-tasking and queues to asynchronously read infrared (IR) commands from an infrared remote control.

Microcontroller Platform Architectures

In order to best understand any new platform I believe it is instructive to examine some common microcontroller platform architectures and then position the new platform appropriately. Broadly speaking there are two cases:

  1. Your program is downloaded into some kind of processor memory such as flash and executed by the microcontroller chip. I call this native mode. In this case a compiler or assembler is needed to convert a program into machine code and usually some kind of programmer is needed to download the program into the processor flash memory. A variation here (at least for Atmel AVR chips) is that a bootstrap loader can be downloaded once to the chip and then the bootstrap loader is used to download machine code programs.
  2. Your program in downloaded into separate memory such as EEPROM and interpreted by some kind of runtime that is preprogrammed in processor memory such as flash. I call this non-native mode. In this case a compiler is needed to convert a program into an intermediate form and the runtime has a built-in loader that downloads programs. After download the runtime loads bytes of the intermediate form and a runtime interpreter decides what to do.

Within these two cases some further subdivision is possible that results in four categories described in the table below:

Architecture Category




Program compiled into machine code

e.g. AVR-GCC and Bascom


  • Fast
  • Choice of AVR chips

  • Needs library of functions to do anything useful
  • Requires chip programmer and perhaps simulator/emulator

Assembler program



  • Very Fast
  • Choice of AVR chips
  • Nothing beats direct to the metal

  • Needs library of functions to do anything useful
  • Hardest to write and maintain
  • High skill level
  • Requires chip programmer and perhaps simulator/emulator

Program compiled into intermediate (virtual machine) language

e.g. ZBasic, BasicX and JStamp


  • Simple hook up (power and 3-wire RS-232)
  • Huge number of built-in features make it very easy to get started
  • Multi-tasking support

  • Interpreted virtual machine language inside the microcontroller chip so performance is average.

Program compiled into tokenized form

e.g. Basic Stamp


  • Simple hook up (power and 3-wire RS-232)
  • Many built-in features make it easy to get started

  • Interpreted basic tokens inside the PIC chip so performance is poor
  • Lack of floating point math and other routines.
  • No multi-tasking support
  • Small RAM memory

To summarize, AVR compilers and assemblers do an excellent job but need additional hardware support and can have a steep learning curve. In addition they cannot be used quickly and easily to prototype an idea without an extensive library of support routines. The Basic Stamp solution is very popular with hobbyists and it is easy to get started. However performance is poor at best and this platform quickly “runs out of steam” for more advanced applications.

The middle ground is held by the platforms that combine the best of both worlds using a virtual machine architecture and a comprehensive library of routines to access the chip facilities. This makes both prototyping and writing production-level applications very easy. The BasicX chip is showing its age and it has not really been substantially changed since its introduction in 2002 when it was based on an Atmel AT90S8535.  ZBasic has a number of advantages over its predecessors such as BasicX and Basic Stamps because it has better performance, larger RAM and EEPROM memory, more capable function library and modern IDE-based editor and compiler.

All Content Copyright 2005-2014 Oak Micros. All Rights Reserved. See Terms and Conditions.
Powered by Joomla and osCommerce.