BASIC STAMP FAQ (FREQUENTLY ASKED QUESTIONS AND ANSWERS)
STAMP FAQS TABLE OF CONTENTS GENERAL INFORMATION 4 WHAT IS THE BASIC STAMP? 4 DOES THE BASIC STAMP LOSE ITS PROGRAM WHEN I REMOVE THE BATTERY OR POWER SUPPLY? 4 DOES THE BASIC STAMP COME IN DIFFERENT VERSIONS ? 5 WHAT IS THE DIFFERENCE BETWEEN THE BASIC STAMP REV.
STAMP FAQS PROGRAMMING INFORMATION TABLE OF CONTENTS 12 HOW DO I PROGRAM THE BASIC STAMP? 12 HOW DO I CONNECT THE BASIC STAMP TO MY COMPUTER FOR PROGRAMMING? 12 HOW DOES MY PROGRAM GET STORED IN THE BASIC STAMP? 12 HOW DO I ERASE THE BASIC STAMP’S PROGRAM SPACE? 12 HOW DO I REPROGRAM THE BASIC STAMP? 13 HOW BIG OF A PROGRAM CAN I STORE IN THE BASIC STAMP? 13 CAN I EXPAND THE PROGRAM MEMORY? 13 CAN I EXPAND THE DATA MEMORY? 13 HOW DIFFICULT IS IT TO PROGRAM THE BASIC STAMP? 13 CAN I PROGRAM THE BASIC STA
STAMP FAQS PROGRAMMING INFORMATION What is the BASIC Stamp? The BASIC Stamp is a microcontroller developed by Parallax, Inc. which is easily programmed using a form of the BASIC programming language. It is called a “Stamp” simply because it is close to the size of an average postage stamp. Does the BASIC Stamp lose its program when I remove the battery or power supply? No, your PBASIC code is stored inside a serial EEPROM on-board the BASIC Stamp.
STAMP FAQS PROGRAMMING INFORMATION Does the BASIC Stamp come in different versions? Yes. Currently there are four functional versions of the BASIC Stamp and seven physical versions. The BASIC Stamp line consists of the BASIC Stamp I, the BASIC Stamp II, the BASIC Stamp IIe and the BASIC Stamp IIsx . The BASIC Stamp I is available in three package types (physical versions) as shown in figures 1a, 1b and 1c below. The BASIC Stamp 1 Rev. D is a through-hole, socketed package (with prototyping area).
STAMP FAQS PROGRAMMING INFORMATION What is the difference between the BASIC Stamp Rev. D (sometimes just called “BASIC The original version of the BASIC Stamp I was simply called, “BASIC Stamp”. That name was sufficient until the arrival of the new physical package type, as well as the second model in the Stamp line, the BASIC Stamp II. At that point, the original version was split into two package types, the Rev. D and the BS1-IC; both of which are considered to be the “BASIC Stamp I”.
STAMP FAQS PROGRAMMING INFORMATION Are there any production possibilities with the BASIC Stamp? Yes. We offer the major components of the BASIC Stamp circuit (the interpreter, the EEPROM and the resonator) separately at a discounted price for tight integration into your products. For initial development purposes, request the OEMBS1 or OEMBS2 product. These are “OEM” versions of the modules with an easy to follow circuit layout and all the components provided in through-hole format.
STAMP FAQS PROGRAMMING INFORMATION What are the main differences between the BASIC Stamps? The BASIC Stamp I has 8 I/O pins, room for 80 to 100 lines of code, executes approximately 2000 instructions per second and requires a parallel interface for programming. The BASIC Stamp II has 16 I/O pins, 2 dedicated serial port pins (1 input, 1 output), room for 500 to 600 lines of code, executes approximately 4000 instructions per second and requires a serial interface for programming.
STAMP FAQS PROGRAMMING INFORMATION How many I/O pins does the BASIC Stamp have? The BASIC Stamp I has 8 I/O pins while the BASIC Stamp II, BASIC STAMP IIe and BASIC Stamp IIsx has 16 I/O pins plus 2 special serial port pins (1 input, 1 output). What can I use the I/O pins for? The BASIC Stamp’s I/O pins are perfectly suited for digital input and output with TTL/CMOS level (0 to 5 volt) signals. However, you can use some special commands and techniques to input and output limited analog signals.
STAMP FAQS PROGRAMMING INFORMATION What is the VIN pin used for? The VIN (Voltage Input) pin is used to power the BASIC Stamp from a 6 to 15 volt source. The VIN pin is the positive connection while the VSS pin is the negative, or ground, connection. When powered from the VIN pin the BASIC Stamp regulates the voltage down and outputs +5 volts on the VDD pin. For optimal operation, it is recommended to keep the voltage below 12 volts for the BASIC Stamp I and II, IIe, and around 7.
STAMP FAQS PROGRAMMING INFORMATION How much current can the BASIC Stamp’s on-board regulator provide? The built in 5-volt regulator on the BASIC Stamp I and BASIC Stamp II can supply 50 mA of current if powered by a 12-volt source. The BASIC Stamp IIsx’s regulator can supply 150 mA if powered by a 7.5-volt source. The BASIC Stamp I consumes 2 mA in running mode and the BASIC Stamp II consumes 7 mA. This leaves 48 mA and 43 mA respectively for use with other circuitry via the VDD pin and the I/O pins.
STAMP FAQS PROGRAMMING INFORMATION Does the BASIC Stamp support interrupts? No, the interpreter chip used in the BASIC Stamp does not support interrupts. In many cases, a fast polling routine may be used to accomplish the same effect, however, depending on the number and size of the tasks involved in some applications, this will not be fast enough and the BASIC Stamp may not be a plausible solution.
STAMP FAQS PROGRAMMING INFORMATION How do I reprogram the BASIC Stamp? Simply re-connect it to the computer, run the BASIC Stamp editor and press ALT-R (DOS software) or CTRL-R (Windows software). How big of a program can I store in the BASIC Stamp? The BASIC Stamp I has 256 bytes of program storage; enough for 80 to 100 lines of PBASIC1 code. The BASIC Stamp II has 2048 bytes of program storage; enough for 500 to 600 lines of PBASIC2 code.
STAMP FAQS PROGRAMMING INFORMATION How much space does each PBASIC command take? Each command takes a variable amount of space within the BASIC Stamp’s EEPROM. It varies due to complexities of the command itself and the types of arguments you supply each command. Generally, each command takes 2 to 4 bytes of memory space, however, commands like SERIN, SEROUT, LOOKUP and LOOKDOWN, which accept a variable length list of arguments, may take tens of bytes or more.
STAMP FAQS PROGRAMMING INFORMATION How do I print out my PBASIC programs? The BASIC Stamp DOS editors do not have a print option built-in, however, the source file created by the editor is simply a DOS text file. This means it can be printed with the standard PRINT or TYPE commands as in: PRINT source.bas -orTYPE source.bas > LPT1 where source.bas is the name of your PBASIC program. The Windows software features built-in printing support.
STAMP FAQS PROGRAMMING INFORMATION How do I set an I/O pin to input or output mode? There are many ways to set the I/O pin directions. The most readable and intuitive method is to use the INPUT and OUTPUT commands. For example: INPUT 5 OUTPUT 6 will set I/O pin 5 to an input and I/O pin 6 to an output. By default, upon reset or startup, all I/O pins are inputs, thus only the second line of code above is really necessary.
STAMP FAQS PROGRAMMING INFORMATION How do I make an I/O pin output a high or a low? As with setting I/O pin directions, there are many ways to set the I/O pin states. The most readable and intuitive method is to use the HIGH and LOW commands. For example: HIGH 5 LOW 6 will first set I/O pin 5 to output mode and then set it to a high (+5V) state. The second line will first set I/O pin 6 to output mode and then set it to a low (0V) state.
STAMP FAQS PROGRAMMING INFORMATION How do I input or output data in parallel on the I/O pins? All BASIC Stamps have predefined variables that refer to the I/O pins. On the BASIC Stamp I, the PINS variable refers to all eight I/O pins. Thus code such as: SYMBOL Snapshot = B0 Snapshot = PINS would copy the current state of all I/O pins (an 8-bit byte) into the variable Snapshot.
STAMP FAQS PROGRAMMING INFORMATION The LET command is not available on the BASIC Stamp II, IIe and IIsx. Does this mean the BASIC Stamp II, IIe and IIsx cannot perform mathematical operations? No. The LET command on the BASIC Stamp I was optional; i.e.: you could leave it out of the variable assignment statement or equation and it would work normally.
STAMP FAQS PROGRAMMING INFORMATION How does the fpin (flow control pin) work in the SERIN and SEROUT commands on the BASIC Stamp II, IIe and IIsx? The optional fpin argument in the SERIN and SEROUT commands allows the use of an I/O pin as a hardware flow control line between two BASIC Stamp II, IIe and IIsx’s at baud rates of up to 19.2 kBps. The flow control pin is always controlled by the receiving device (SERIN) and monitored by the sending device (SEROUT).
STAMP FAQS PROGRAMMING INFORMATION How can I define an alias to an I/O pin or another variable? In the BASIC Stamp I you could specify the following: SYMBOL Counter SYMBOL Index SYMBOL LED = B0 = B0 = PIN0 to designate the symbol Index as an alias to the Counter variable and the symbol LED as an alias to I/O pin 0. Since Counter and Index use the same register, B0, anytime Counter is changed, Index will change in the same way.
STAMP FAQS PROGRAMMING INFORMATION How do I define aliases to specific bytes within a word array on the BASIC Stamp II, IIe and IIsx? The BASIC Stamp II, IIe and IIsx uses a very relaxed and flexible indexing scheme when it comes to arrays of RAM space. When trying to define aliases in this way it is best to view the entire RAM space as one array of word, byte, nibble and bit registers.
STAMP FAQS PROGRAMMING INFORMATION Stamp Specifications (revised 6/00) Released Products Package Package Size (L x W x H) Environment Microcontroller Processor Speed Program Execution Speed RAM Size Scratch Pad RAM EEPROM (Program) Size Number of I/O pins Voltage Requirements Current Draw @ 5V Source / Sink Current per I/O Source / Sink Current per unit PBASIC Commands PC Programming Interface DOS Text Editor Windows Text Editor Rev.D / BS1-IC PCB w/Proto / 14-pin SIP 2.5" x 1.5" x .5" / 1.4" x .6" x .