A Basic Stamp 2 for About Half the Price

copyright, Peter H. Anderson, Aug, '03


For the indefinite future, the price is $21.00 for the first Homebrew BS2 which includes documentation and a logic probe for debugging and $19.00 for each additional Homebrew kit which does not include these. Note that if you have already purchased a Homebrew BS2 from me and you have the documentation and probe, you may simply order additional Homebrew kits for $19.00.

Loaner Program

Introduction.

The Basic Stamp 2 Module is conveniently packaged in a 24 pin DIP. It is available from a variety of sources including us. There is no question but that it is convenient.

However, you can "roll your own" and save a bit of money. This approach may be particularly attractive in an academic or club environment where many Stamps are being used in conjunction with a solderless breadboard and there is someone who can supervise the assembly and quickly debug. It is attractive for a hobbyist who desires a number of Stamps and uses a solderless breadboard environment.

The BS2-Homebrew Kit includes a Parallax PBASIC2/P Interpretter in a 28-pin DIP, a 24LC16B serial EEPROM (8-pin DIP), MAX232 (16-pin DIP), 20 MHz crystal and two 20 pFd capacitors, four resistors, four capacitors, a diode and lengths of 22 AWG solid wire suitable for a solderless breadboard.

Assembly time varies depending on experience. I didn't tell my two student assistants that they were being timed, but both had working circuits within about 20 minutes. However, they have had a good deal of experience. I do think that assembly shoud be less than an hour.

This "roll your own" approach can be very cost effective, but there is a bit of work and clearly, a 28 pin DIP, 8 pin DIP, 16 pin DIP, 20 MHz crystal and associated capacitors takes a good deal more space than a "ready to go" $49.00 24 pin BS2-IC.


Content of the BS2-Homebrew Kit.

Take a moment to familiarize yourself with the content of the Homebrew Kit. It consists of;

Important Note.

This design requires a 5.0 Volt regulated voltage source.

This may be implemented using an external 5.0 Volt regulator and we have a Power Supply kit which includes a wall transformer, 7805 regulator and heat sink, filter capacitors and documentation which is suitable for this application. In addition to providing a source of +5V for the "Homebrew Stamp", the supply may be used to power +5V peripherals and nominally +12V is available for powering motors, solenoids and lamps.

It is important that you appreciate that applying voltages other than +5VDC to the MAX232, PIC16C57 Basic Interpretter and 24LC16B EEPROM will cause irreversible damage.

Assembly.

A suggested layout on a solderless breadboard is presented in Figure #1.

Figure #2 illustrates the overall circuitry.

Notes.

1. It is suggested that you first wire the MAX232. Pay particular attention to the polarity of the four electrolytic capacitors.

Note that the MAX232 is powered by +5VDC at terminal 16 and ground at terminal 15. It contains circuitry to generate nominally +8.0 Volts at terminal 2 and -8.0 Volts at terminal 6 and these potentials may be verified with a voltmeter.

2. Connect the 20.0 MHz crystal between terminals 27 and 28 of the PIC and the two 20 pFd capacitors to ground. Note that the crystal is a symetrical device.

3. Note that the "switch" shown at terminal 28 is used to manually reset the PIC. For normal operation, this is open. The switch may be implemented with either a wire or a normally open pushbutton such as those supplied with our Basic Stamp 2 Starter Package.

4. Prior to applying power, take a moment to check your wiring and most importantly the connection of +5V and GRD to the integrated circuits.

5. Apply power and connect the circuitry to a PC Com Port. Use a voltmeter to verify the eight potentials shown in circles.

If you do not have a voltmeter, use the Morgan Logic Probe with a series 4.7K limiting resistor as shown in Figure #3. The series resistor protects the Probe from potentials which are higher than +5V or lower than 0.0 V.

When using the Logic Probe, a potential of less than nominally 1.4V will cause the LED to be off and greater than 1.4V to be on. Thus, in observing those points which are less than -3.0V will cause the LED to be off and those points greater than 2.5 will cause the LED to be on.

6. Use the Stamp 2 program to write a simple program. For example;

	DIRS=$0001	' make P0 an output

TOP:	HIGH 0
	PAUSE 250
	LOW 0
	PAUSE 250
	HIGH 0
	GOTO TOP
If your program downloads, use the Logic Probe is to verify that P0 at PIC terminal 10 is continually flashing on and off for 250 msecs.

If your program fails to download and gives a "Hardware not Found Error";

A. Be sure you are running the Stamp 2 program from DOS. If you are running Windows95, reboot in the DOS mode.

B. Use the Logic Probe to observe /MCLR at PIC terminal 28. Normally it should be at a logic one, LED on. On downloading, you should see this momentarily go to a logic zero as the Stamp 2 program resets the PIC.

C. Use the logic probe to verify the SDA and SCL leads at PIC terminals 6 and 7 are in transition (Logic Probe LED flashing) as the PIC fetches the tokens from the EEPROM.

Operation.

When using this "Homebrew Stamp 2", note that the 16 I/O terminals P0 through P15 are at PIC terminals 10 through 25. A simple algorithm to calculate the terminal number is to add ten to the functional designation. That is P5 is at terminal 15. This differs from the "ready to go" 24-pin DIP.

When in the operational mode the MAX232 may be used to communicate with a PC or similar terminal. However, an additonal RS232 transmitter and receiver is available for serial communication with another peripheral. A typical application is illustrated in Figure 4.