21.11.2014 Views

STAMP 2 Communications And Control Projects.pdf

STAMP 2 Communications And Control Projects.pdf

STAMP 2 Communications And Control Projects.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AN EXERCISE 13<br />

TABLE 1-4<br />

ORIGINAL <strong>STAMP</strong> 2 VERSUS ALTERNATIVE <strong>STAMP</strong> 2 PINOUTS<br />

P DESIGNATION ORIGINAL <strong>STAMP</strong> 2 PIN ALTERNATIVE <strong>STAMP</strong> 2 PIN<br />

P0 5 10<br />

P1 6 11<br />

P2 7 12<br />

P3 8 13<br />

P4 9 14<br />

P5 10 15<br />

P6 11 16<br />

P7 12 17<br />

P8 13 18<br />

P9 14 19<br />

P10 15 20<br />

P11 16 21<br />

P12 17 22<br />

P13 18 23<br />

P14 19 24<br />

P15 20 25<br />

two 10-k resistors and two momentary pushbutton switches as shown. The LEDs are<br />

connected to pins P0 and P1 and the two input switches are connected to pins P2 and P3.<br />

The program will begin blinking one of the LEDs when switch S1 is pressed. When S2 is<br />

pressed, the second LED will begin blinking with a double blink. The blink program<br />

demonstrates the use of inputs and outputs as well as whether the alternative <strong>STAMP</strong> 2 is<br />

functioning. Once the test circuit has been breadboarded or built on a perfboard or PC<br />

board, you are now ready to load your first program into the microprocessor. Once you<br />

have assembled your alternative <strong>STAMP</strong> 2, you will need to connect it to your PC’s serial<br />

port, using a serial programming cable. Once your serial cable has been built and connected<br />

between your PC and the alternative <strong>STAMP</strong> 2, apply power through the 5-V regulator<br />

and you are ready to roll. Locate the Windows desktop editor software <strong>STAMP</strong>-<br />

W.EXE and call it up on your PC. Once the program has been installed and called up, you<br />

can apply power to your alternative <strong>STAMP</strong> 2 circuit and support chips. Remember, if you<br />

are using the alternative <strong>STAMP</strong> 2, you will need to provide 5 V to pin 2. You are now ready<br />

to begin programming your new <strong>STAMP</strong> 2 microcontroller. Type the BLINK.BS2 program<br />

(Listing 1-1) into the Windows <strong>STAMP</strong> 2 editor and then run the blink program to test your<br />

alternative <strong>STAMP</strong> 2. Your alternative <strong>STAMP</strong> 2 should now come to life as soon as you<br />

press switch S1 or S2. You are now on your way to programming and enjoying your<br />

<strong>STAMP</strong> 2 microprocessor.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!