Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesThe Taming Power of the Small


September 1994 / Features / The Taming Power of the Small

I've seen other small microcontroller development systems besides the Basic Stamp from Parallax. Blue Earth Micro, for example, sells a device that connects to your PC's serial port and looks no bigger than an RS-232 gender-changer, yet it includes an 8051 with 32 KB of RAM and a BASIC interpreter on-board. But even these features can't compete with the elegant simplicity of the Basic Stamp (see the photo).

The Basic Stamp is a surprisingly small, yet surprisingly complete, PIC 16C56 development system. It consists of two--that's right, two--ICs, a 4-MHz resonator (i.e., an oscillator circuit), a voltage regulator, and a handful--not even a thimbleful, actually--of passive electronics. The whole thing can be powered by a 9-V transistor battery (you can see the battery clip in the photo).

A three-pin header connect s the Basic Stamp to your PC's printer port via a cable supplied by Parallax. Parallax also supplies development software that allows you to program the Basic Stamp in a trimmed-down version of BASIC.

Measuring 1 1/2 by 2 1/2 inches, the Basic Stamp is not much bigger than a Matchbox car. When you consider that at least half of the board's surface area is prototyping area, the Basic Stamp becomes even more amazing.

The board's larger chip is the PIC 16C56 processor. Parallax has programmed it with a run-time kernel that executes the tokenized BASIC program that you create using the development software mentioned above. The code on the PIC 16C56 also contains all the routines necessary to download the program from your PC onto the board's other chip--a 256-byte serial EEPROM. Eight of the PIC processor's pins are available as I/O from a header strip that lies adjacent to the prototyping space.

The Basic Stamp's dialect of BASIC is limited but capable. Obviously, mathematical expressions ar e restricted to integers, and expression evaluation proceeds from left to right. Multiplication and division are a little strange in that there are separate operations for returning the high word and the low word of the result. Also, programs have access to only seven general-purpose variables.

Nevertheless, you can use LET statements, GOSUB...RETURN statements, IF...THEN statements, and FOR...NEXT statements. Furthermore, the language's designers have added numerous special functions that are useful for--or even critical to--embedded applications builders.

For example, the BUTTON function reads the state of a switch on an input pin, handles debouncing automatically, and lets you specify an auto-repeat delay and rate (if the button is held down). The PULSIN function reads the duration of a pulse on one of the PIC's I/O pins, accurate to 10 microseconds. The PWM function will output a pulse-width modulation on one of the processor's output pins. With the SERIN and SEROUT functions, you can specif y pins as serial inputs and/or outputs and transmit or receive characters at speeds of up to 2400 bps.

By anyone's standards, the Basic Stamp is quite an accomplishment of both hardware and software engineering. Documentation from Parallax suggests that it's possible to get, on average, about 80 lines of BASIC on a Basic Stamp. And since your code is being programmed into an EEPROM each time you download it, it's quite reasonable for you to simply take your development system and attach it directly to whatever target it will be controlling.

Personally, I'd love to get a chance to look at the source to the code in the PIC 16C56. Parallax managed to cram all the run-time capabilities of the functions described earlier--the BASIC control statements; digital and analog I/O handling; serial ports; and even the code to communicate with the PC, download the tokenized program into the EEPROM, and execute the tokens--into 512 12-bit instructions. If I were to achieve a similar programming feat, I would d ie a happy man.


Up to the Features section contentsGo to previous article: Processors ProliferateSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network