Getting Started With PICAXE Microcontrollers
put and a low-level output creating a
direct short in the connection, which
can damage one or both PICAXEs.
Power-up again, and download
TestTerm.bas to the 08M. This simple
program receives a single key-press from
the Terminal and sends back an appropriate six-character response. There are
ways to write serial communications
software that allow for variable-length
responses, but they all require testing
each received byte for an end-of-line
character (usually ACSII character 13,
which is the “cr” character). This complicates the software and slows things
down considerably, so we are using the
fast and easy approach of controlling
the length of the transmission.
Next, download Terminal.bas to
the 18X. The terminal program is more
complicated; essentially, it performs
the following tasks:
• Wait for a key-press on the
• Echo the key-press on the LCD.
• Serially transmit the key-press to the
• Wait for the six-character serial
response from target project.
• Display the target’s response on the
We have already seen most of the
code in Terminal.bas; the major new
portion is the “scanloop” routine in the
main program. The most important part
of the code to understand is the
portion that receives and echoes the
six-character response from the target,
so a little explanation is in order. Similar
to BASIC Stamp processors, PICAXEs
have 14 variables available to the user
(designated as b0, b1, … b13). We are
using the last six of these variables to
receive the response [in the line “serin
2, N2400, b8, b9, b10, b11, b12, b13],
® Manufacturing Quality
Products since 1983!
call toll free
refer to or visit
Tenma sets the standard for high-quality, value priced products
including: Oscilloscopes, pattern generators, function generators,
DMMs, spectrum analyzers, frequency counters, thermometers,
replacement test leads, solder and desolder stations,
solder, desoldering braid, irons and accessories.
Speaker Measurement Interface
The Tenma SMI is essential for deign, refurbishing or DIY speaker building.
Finally, accurate speaker measurements can be performed in most any
shop or home with no special microphones or testing area required.
• Self-powers from any USB port
• Provides Fs, Cms, Qts, Vas, BL, Re, Le, Mms and CMS measurements
• T/S Parameters for mid-ranges and tweeters
• Closed, vented and infinite baffle box simulation
• Measure resistors, inductors, capacitors, test leads, cables and more
• Measures 1Hz ~ 20KHz with 0.0 and 0.1° phase accuracy
For more information, visit www.tenma.com
Distributed exclusively by MCM Electronics
Source Code: NVM58
60 March 2007