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

Application Notes

ZBasic Application Notes
The available application notes are listed below. Note that some have an accompanying .zip file with source code and other supporting files.
AN224 - Using Arduino Ethernet Classes in ZBasic  09 Feb 2013
Source Code
The Arduino Ethernet classes provide a means to incorporate Ethernet functionality in a ZBasic application. This application note demonstrates this by way of four sample applications: an HTTP server, an HTTP client, a UDP server and a UDP client.
AN223 - Using Arduino Code in ZBasic Applications  28 Jan 2013
Source Code
The popularity of the Arduino platform has resulted in the availability of a significant amount of embedded application and library code for it. However, many embedded developers and hobbyists prefer the simplicity of ZBasic rather than learning the Arduino's Wiring-based language. This application note describes a simple way to incorporate Arduino procedures and libraries in your ZBasic application or compile a complete Arduino application for a ZBasic target device. The accompanying code archive contains ZBasic-Arduino compatibility source code and pre-built linkable libraries for several ZBasic target devices.
AN222 - Interfacing an SD Flash Drive  10 May 2012
Source Code
An SD Flash drive can be a useful addition to many projects, allowing storage of data collected or providing a store for large amounts of data to be used in the application. This application note presents information on connecting an SD Flash drive to a native mode ZBasic device and using the open source FatFS code base to implement filesystem functions. Information is also presented describing how to import information into a ZBasic application about identifiers (e.g. variables, structures, enumerations, etc.) defined in C/C++ header files. Example code is included targetting the ZX-24n but the code is easily adapted to most native mode ZX and AVR generic target devices.
AN221 - Interfacing Rotary Encoders  12 January 2009
Source Code
A rotary encoder can be a useful human interface element for many projects. This application note presents information on rotary encoders and describes how to interface them to a ZX microcontroller (or other microcontroller). Example code is included demonstrating the ideas described.
AN220 - Interfacing a Parallel LCD  24 June 2008
Source Code
This application note presents three methods for connecting an inexpensive character oriented parallel LCD to a ZX microcontroller (or other microcontroller) using 7, 3 or 2 I/O lines. Example code is included containing the necessary interface code plus a collection of useful higher level routines for managing the LCD and displaying characters. Although the example code is written for a 2x16 LCD (two rows, sixteen columns), it can be easily adapted to displays with other geometries.
AN219 - Implementing I2C and SPI Slaves  21 June 2008
Source Code
With the introduction of native mode ZX devices it became possible to implement a broader range of applications, notable among which are applications that require a customized interrupt service routine (ISR). Due to the interface timing requirements, implementing an I2C or SPI slave requires a customized ISR (in most cases). This application note illustrates how to implement both an I2C slave and an SPI slave on a native mode ZX device. The source code accompanying this application note contains example I2C and SPI slave implementations along with simple test drivers (i.e. a master) for each slave.
AN218 - Implementing an RS-485 Multi-drop Network  26 January 2007
Source Code
RS-485 networks are used by many industrial applications including process control, building automation and even the control of lights at a concert. This application note describes the simple hardware required to get started with networking ZX devices. The accompanying software provides a sample application and a reusable set of APIs to send and receive messages on a RS-485 network.
AN217 - Measuring the Power Supply Voltage  27 October 2006
Source Code
Some applications, particularly ones that are battery powered, may need a way to monitor the power supply voltage. Doing so using the on-board A/D converter requires a special technique that is described in this application note. The technique can be modified to exploit other special features of the A/D converter as well.
AN216 - High Resolution Pulse Width Modulation  Updated 11 August 2008
Source Code
Pulse width modulation (PWM) is a useful technique for many control applications. This application note describes how to use the PWM capabilities of the ZX microcontrollers in several ways including servo control, H-bridge motor control and digital-to-analog conversion.
AN215 - Measuring Distance using Ultrasonic Echos and Timer1  06 March 2006
Source Code
This application note illustrates how to connect a Devantech SRF05 Ultrasonic Range Finder. The code can be also be used for the SRF04 and the concepts can be applied to many other rangefinder devices as well.
AN214 - Interfacing with the LCD03 Text Display  01 March 2006
Source Code
This application note illustrates how to connect an LCD using the I2C interface. The particular display used is the Devantech LCD03 but the concepts can be applied to many other devices as well.
AN213 - External Device Interfacing  02 February 2006
Most microcontroller applications require the use of external devices. This application note describes some techniques for connecting devices and describes the additional interface circuitry that is sometimes required. Interfacing to low voltage devices is also covered.
AN212 - Getting Hot with the TPA81 Thermal Sensor  26 January 2006 Source Code
This application note describes how to connect and use the Devantech TPA81 Thermal Sensor array.
AN211 - Navigating the CMPS03 Magnetic Compass  24 January 2006 Source Code
This application note describes how to connect and use the Robot Electronics CMPS03 Magnetic Compass.
AN210 - Sharing Data Between Tasks  18 January 2006 Source Code
Multi-tasking is a powerful tool that simplifies programming complex systems. However, properly implementing multi-tasking applications requires a good understanding of the problems that can arise as the various tasks attempt to access data that is shared. Fortunately, there are standard, well-known methods to avoid such problems; this application note discusses how to apply them in ZBasic.
AN209 - Task Management  02 January 2006
This application note describes some techniques for task management including a method to implement a timeout for InputCapture().
AN208 - Using I2C with Devantech Ultrasonic Range Finders  30 December 2005 Source Code
Devices like the Devantech SRF10 ultrasonic range finder are commonly used in robots for collision avoidance or object detection. This application note describes how to connect and use the SRF10 using the I2C interface, exploiting the multi-tasking capability of ZBasic to accommodate the ranging delay.
AN207 - Interfacing to SpeakJet Voice and Sound Synthesizer  26 December 2005 Source Code
The SpeakJet (from Magnevation LLC) is a completely self-contained, single chip voice and complex sound synthesizer. This application note describes how to interface a SpeakJet with a ZX chip and use ZBasic to generate speech or sounds using the SpeakJet chip.
AN206 - Using PlaySound to Generate Audio  07 December 2005 Source Code
The PlaySound subroutine synthesizes an audio signal using data from a digitized audio stream. The interface to PlaySound is quite simple. The more difficult problem is how to get the data into your ZX program. This application note shows how to produce a data stream that is compatible with PlaySound starting from a .wav, .mp3 or other sound file. The accompanying .zip file includes some audio samples and a conversion program that can be used to produce 8-bit PlaySound-compatible data from real number data stream.
AN205 - Interfacing a Matrix Keyboard  Updated 23 June 2008 Source Code
Some applications require a means of obtaining human input. Often, a small keypad (e.g. a TouchTone keypad) is sufficient for this purpose. This application note illustrates several ways to interface a matrix keypad.
AN204 - Input Capture and Multi-tasking for IR Remote Controls  30 November 2005 Source Code
This application note illustrates how to receive and decode signals from an infrared remote control. Using these techniques as a foundation, you can easily add remote controllability to your application.
AN203 - I/O Expansion Techniques  24 November 2005
What to do when you've run out of I/O pins? This application note describes some common techniques for expanding the number of I/O lines available to your application.
AN202 - Using RCTime to Measure Charging Time  22 November 2005
The RCTime() function measures the time required for an input to change logic states. This application note describes how to used this capability to determine the charge or discharge time of a capacitor.
AN201 - Generating DTMF Using FreqOut  22 November 2005 Source Code
This application note demonstrates how to generate Dual-Tone Multi-Frequency signals. Although DTMF was designed to control telephone switching equipment it can be used in other applications as well.
AN103 - Preparing ZBasic Generic Target Devices  30 January 2013
Prior to being used as ZBasic generic target devices, raw AVR chips must be prepared by setting the device fuses, lock bits and installing the bootloader and/or application code.
AN102 - Migrating from the ZX-24 to the ZX-24a or ZX-24p  30 April 2008
This application note describes some of the issues that might be encountered when migrating an application from the ZX-24 to the more capable ZX-24a or ZX-24p.
AN101 - ZX Download and Firmware Update Procedures  30 December 2006
This application note describes the ZX download process in sufficient detail to allow a skilled developer implement their own downloader to communicate with ZBasic device bootloaders.
Copyright © 2005-2018 Elba Corp. All rights reserved.