by William Smith
Programming Microcontrollers
Learning to program microcontrollers is what every electronics beginner needs to put on their to-do list.
Unless you’ve been living in a cave without Internet access, you have probably heard of the BASIC
Stamp 2. This little module from Parallax, Inc., has really changed the hobbyist world and launched a
large batch of new programmers. If you’ve seen a robot kit targeted at the hobbyist crowd, there is a
good chance that a BASIC Stamp 2 is the controlling microcontroller. This popularity also comes with its
share of copycats. I’ve have seen numerous BASIC Stamp 2 compatible modules over the years. Some
program in C language, some in Java, and some based on chips other than the Microchip PIC used
on the BASIC Stamp 2. For the beginner, though, I suggest staying with the Basic language to start.
I suggest one of two options: the BASIC Stamp 2 or the Basic Atom 24.
Imitation is a form of flattery someone once said and
based on that, there must be a lot of affection for what the
Stamp offers because there are a lot of imitators. I feel that
a lot of the imitators just try to do something different than
the BASIC Stamp 2 but not offer a clear alternative that
maintains the Basic code format. One of the Stamp’s
strengths is the PBASIC code which makes it easy for
anyone to program an application. Once you conquer
programming in Basic, you are ready to move on to Basic
compilers and single chip solutions. Unfortunately, so
many of the clones use a completely different language or
completely different format which just adds complexity to
the beginner and no direct upgrade path. In my opinion,
the one clone that got it close and also offers an upgrade
path for the beginner is the Basic Atom.
The Basic Atom 24 module is pin-compatible with
the BASIC Stamp 2 but offers some different features.
Figures 1A and 1B. BASIC Stamp 2 and Basic Atom 24.
A
B
68 SERVO 08.2009
Figure 1 shows the two side-by-side. The Stamp costs $49,
the Atom costs $49.95.
Technical Details
The specs presented in this article will show that you
have two very similar choices when building your first robot
or electronic gadget using a Basic language module. These
details are intended to help you decide which one to use
for your particular application. The most important aspect
is you can easily switch between them since they are
pin-compatible. The specs for the two modules are:
BASIC Stamp:
•Processor Speed: 20 MHz
•Program Execution Speed: 4,000 PBASIC
instructions/sec
•RAM Size: 32 bytes (six I/0, 26 Variable)
•Program Size: 2 KBytes; ~500 PBASIC instructions
•EEPROM: Unused program space
•Number of I/O Pins: 16 + 2 dedicated serial
•Source/Sink Current per I/O: 20 mA/25 mA
•PBASIC Commands: 42
•Package: 24-pin DIP
Basic Atom:
•Processor Speed: 20 MHz
•Program Execution Speed: 30,000 Basic