Prev NEXT

How Microcontrollers Work

Playing with a BASIC Stamp

A screenshot of a typical BASIC program editor

If you would like to play with a BASIC Stamp, it's very easy to get started. What you need is a desktop computer and a BASIC Stamp starter kit. The starter kit includes the Stamp, a programming cable and an application that you run on your desktop computer to download BASIC programs into the Stamp.

You can get a starter kit either from Parallax (the manufacturer) or from a supplier like Jameco (who should be familiar to you from the electronic gates and digital clock articles). From Parallax, you can order the BASIC Stamp D Starter Kit (part number 27202), or from Jameco you can order part number 140089. You will receive the Stamp (pictured below), a programming cable, software and instructions. The kit is $79 from both suppliers. Occasionally, Parallax runs a special called "We've Bagged the Basics" that also includes Scott Edward's Programming and Customizing the BASIC Stamp Computer].

Advertisement

Hooking up the Stamp is easy. You connect it into the parallel port of your PC. Then you run a DOS application to edit your BASIC program and download it to the Stamp.

To run the program in this editor, you hit ALT-R. The editor application checks the BASIC program and then sends it down the wire to the EEPROM on the Stamp. The Stamp then executes the program. In this case, the program produces a square wave on I/O pin 3. If you hook up a logic probe or LED to pin 3 (see the electronic gates article for details), you will see the LED flash on and off twice per second (it changes state every 250 milliseconds because of the PAUSE commands). This program would run for several weeks off of a 9-volt battery. You could save power by shortening the time that the LED is on (perhaps it is on for 50 milliseconds and off for 450 milliseconds), and also by using the NAP instruction instead of PAUSE.