Preparation
-Download: “Basic Stamp Manual.pdf” and “What is a Microcontroller.pdf” to your MAC laptop.
Introduction to Microcontrollers using the BASIC Stamp
What is a microcontroller? (P11 what is a microcontroller)
Is the BASIC stamp a microcontroller or does it contain one?
Why is BASIC in all upper case letters?
How can you tell if a device or appliance contains a micro controller (P11 what is a microcontroller, http://www.howstuffworks.com/microcontroller.htm/printable)
Additional resources:
What is a Microcontroller 3.0
12-14 discusses additional applications of microcontrollers
15-22 downloading and installing drivers and programming software
13-26 chapter summary
Procedure:
o Identify your board (Open the basic stamp editor; launch the help file. Click “Getting Started…”
o Connect your board to the computer
o Test your programming connection
o Write first PBASIC program for your BASIC Stamp
o Creating a new folder on the server to save your programs
o Write a PBASIC program that uses ASCII
o Turn off power when you are going to be away for an extended period of time
If you are using the Board of Education unplug the power supply
Identify components of your board
(Write part description on the following page)
1.______
2. ______
3. ______
4. ______
5. ______
6. ______
7. ______
8. ______
9. ______
Describe the Board Components
1.______
2. ______
3. ______
4. ______
5. ______
6. ______
7. ______
8. ______
9. ______
10. ______
11. ______
12. ______
13. ______
Connecting the BASIC Stamp and Test Programming Connection
Discuss in class the different interface options
1. Connect the interface cable to an available USB port on the computer.
2. Launch the BASIC Stamp Editor------àStart>All Programs>Parallax Inc>BASIC Stamp Editor>BASIC Stamp Editor.
3. Connect the other end of the interface cable to the appropriate port on the BASIC Stamp.
4. Power up the board
- if you are using the “Board of Education” move the power switch to position 1 after you plug in the power supply
- If you are using the “Homework Board” just plug in a 9 volt battery.
5. From the run Menu choose identify.
- The dialog box that pops up should have the BASIC stamp listed under “Device Type.” If it is listed go to step 6.
- If it does not appear see your instructor or consult the help file and click connection troubleshooting under the contents.
Write first PBASIC program for your BASIC Stamp/
Creating a new folder on the server to save your programs
6. Choose save as from the File menu.
- From the drop down at the top of the dialog box choose the student server.
- Right click in the window and choose New>Folder.
- Name the folder BASIC Stamp and double click it to open it then click save.
- Because we are working in a lab protected by Deep Freeze you may have to reselect this location each day we work on a new program.
7. Type the remaining lines into the editor window exactly as they appear. Notice that the lines are color coded. This makes the code easier to read, understand and correct if there are problems.
8. Now choose Run>Run
- You will notice a progress window will appear for a short period of time and the debug terminal will appear. In the window you should see the message that you typed above.
- What happens if you press the reset button on the BASIC Stamp?
9. Change the message in the window and download the program to your BASIC Stamp by choosing one of the following methods: F9, ctrl-r, or clicking the blue run button in the toolbar at the top of the screen.
10. Close the Debug terminal and unplug the power from your module and unplug it from the interface cable.
11. Trade your board only with another group and connect as before. ADDING POWER IS THE LAST STEP.
12. Press reset. What is displayed on the screen? What have you just proven?
13. Open the help file from the BASIC Stamp Editor and go to the page First Program under getting started.
- Complete from “How FirstProgram.bs2 Works” through “When you’re Done”
Quick Reference
If you forget to write these down during the lesson you can open the “What is a Microcontroller.pdf” and do a find. On the PC press ctrl-f on the mac press command-f type in the search term. Each time you press the enter key the computer will find the next incidence of the search term. The first several are provided for you
8
Page