What's a Microcontroller?

Total Page:16

File Type:pdf, Size:1020Kb

What's a Microcontroller? What’s a Microcontroller? Student Guide VERSION 3.0 Page 2 · What’s a Microcontroller? WARRANTY Parallax warrants its products against defects in materials and workmanship for a period of 90 days from receipt of product. If you discover a defect, Parallax will, at its option, repair or replace the merchandise, or refund the purchase price. Before returning the product to Parallax, call for a Return Merchandise Authorization (RMA) number. Write the RMA number on the outside of the box used to return the merchandise to Parallax. Please enclose the following along with the returned merchandise: your name, telephone number, shipping address, and a description of the problem. Parallax will return your product or its replacement using the same shipping method used to ship the product to Parallax. 14-DAY MONEY BACK GUARANTEE If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This guarantee is void if the product has been altered or damaged. See the Warranty section above for instructions on returning a product to Parallax. COPYRIGHTS AND TRADEMARKS This documentation is Copyright 2003-2009 by Parallax Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax Inc. Duplication for educational use, in whole or in part, is permitted subject to the following conditions: the material is to be used solely in conjunction with Parallax products, and the user may recover from the student only the cost of duplication. Check with Parallax for approval prior to duplicating any of our documentation in part or whole for any other use. BASIC Stamp, Board of Education, Boe-Bot, Stamps in Class, and SumoBot are registered trademarks of Parallax Inc. HomeWork Board, PING))), Parallax, the Parallax logo, Propeller, and Spin are trademarks of Parallax Inc. If you decide to use any of these words on your electronic or printed material, you must state that “(trademark) is a (registered) trademark of Parallax Inc.” upon the first use of the trademark name. Other brand and product names herein are trademarks or registered trademarks of their respective holders. ISBN 9781928982524 3.0.0-09.12.09-HKTP DISCLAIMER OF LIABILITY Parallax Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, or any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products. Parallax is also not responsible for any personal damage, including that to life and health, resulting from use of any of our products. You take full responsibility for your BASIC Stamp application, no matter how life- threatening it may be. ERRATA While great effort is made to assure the accuracy of our texts, errors may still exist. Occasionally an errata sheet with a list of known errors and corrections for a given text will be posted on the related product page at www.parallax.com. If you find an error, please send an email to [email protected]. Table of Contents Preface.........................................................................................................................7 About Version 3.0 ...........................................................................................................7 Audience.........................................................................................................................8 Support Forums ..............................................................................................................8 Resources for Educators ................................................................................................9 Foreign Translations .....................................................................................................10 About the Author...........................................................................................................10 Special Contributors .....................................................................................................10 Chapter 1 : Getting Started......................................................................................11 How Many Microcontrollers Did You Use Today? ........................................................11 The BASIC Stamp 2 – Your New Microcontroller Module ............................................11 Amazing Inventions with BASIC Stamp Microcontrollers .............................................12 Hardware and Software ................................................................................................15 Activity #1 : Getting the Software..................................................................................15 Activity #2 : Using the Help File for Hardware Setup....................................................21 Summary ......................................................................................................................23 Chapter 2 : Lights On – Lights Off..........................................................................27 Indicator Lights .............................................................................................................27 Making a Light-Emitting Diode (LED) Emit Light ..........................................................27 Activity #1 : Building and Testing the LED Circuit.........................................................28 Activity #2 : On/Off Control with the BASIC Stamp.......................................................37 Activity #3 : Counting and Repeating............................................................................43 Activity #4 : Building and Testing a Second LED Circuit ..............................................46 Activity #5 : Using Current Direction to Control a Bicolor LED .....................................50 Summary ......................................................................................................................57 Chapter 3 : Digital Input – Pushbuttons.................................................................61 Found on Calculators, Handheld Games, and Applicances .........................................61 Receiving vs. Sending High and Low Signals ..............................................................61 Activity #1 : Testing a Pushbutton with an LED Circuit.................................................61 Activity #2 : Reading a Pushbutton with the BASIC Stamp ..........................................65 Activity #3 : Pushbutton Control of an LED Circuit .......................................................70 Activity #4 : Two Pushbuttons Controlling Two LED Circuits........................................73 Activity #5 : Reaction Timer Test ..................................................................................79 Summary ......................................................................................................................87 Chapter 4 : Controlling Motion................................................................................93 Microcontrolled Motion..................................................................................................93 On/Off Signals and Motor Motion .................................................................................93 Introducing the Servo....................................................................................................93 Page 4 · What’s a Microcontroller? Activity #1 : Connecting and Testing the Servo............................................................95 Activity #2 : Servo Control Test Program....................................................................102 Activity #3 : Control Servo Hold Time.........................................................................112 Activity #4 : Controlling Position with your Computer .................................................118 Activity #5 : Converting Position to Motion .................................................................126 Activity #6 : Pushbutton-Controlled Servo ..................................................................129 Summary ....................................................................................................................134 Chapter 5 : Measuring Rotation............................................................................ 139 Adjusting Dials and Monitoring Machines...................................................................139 The Variable Resistor Under the Dial – a Potentiometer............................................139 Activity #1 : Building and Testing the Potentiometer Circuit .......................................141 Activity #2 : Measuring Resistance by Measuring Time .............................................143 Activity #3 : Reading the Dial with the BASIC Stamp .................................................150 Activity #4 : Controlling a Servo with a Potentiometer................................................156 Summary ....................................................................................................................164
Recommended publications
  • The Parallax 2004 Fall Product Guide Is Brought to You by Parallax, Inc
    www.parallax.com The Parallax 2004 Fall Product Guide is brought to you by Parallax, Inc. and our network of 70+ distributors. This product guide is unique from all of our previous guides since the pricing is not published next to the Parallax part number and product description. Parallax, Inc. 599 Menlo Drive, #100 For pricing information, please visit your Rocklin, CA 95765, USA distributor’s web site or view the included price list (may not be applicable). Telephone: Office/Sales/Support: (916) 624-8333 The following 30 pages focus on Parallax’s Fax: (916) 624-8003 core products, including those which are most often carried by distributors. This includes Callers in the United States only: but is not limited to the following: BASIC Toll-Free Sales: 888-512-1024 Stamp microcontrollers, Programming Boards, Toll-Free Technical Support: 888-99-STAMP Starter Kits, Application Modules, Accessories, Robotics, Motor Control, Education Stamps Please Note: Sales Department, Technical in Class, Industrial, SX-Key Programming Support, and General Office hours are Monday Tools and Chips, Altera FPGA Development through Friday from 7:00 a.m. to 5:00 p.m., Tools. Additional accessories and components Pacific Standard Time. may be available from your distributor or www.parallax.com. Internet: www.parallax.com Our distributors are very responsive to customer requests and are able to procure E-mail: Parallax products that are available from our [email protected] web site. For international customers, this is [email protected] of extreme importance since distributors use [email protected] their expertise to provide you with the best pricing available after paying for overseas BASIC Stamp, Board of Education, Stamps shipping charges, duties, and taxes.
    [Show full text]
  • Drive Motor and Encoder
    ARobot Mobile Robot For Hobbyist, Research and Education Assembly and User Guide Copyright (c) 2005 Arrick Robotics All Rights Reserved Robotics.com ARobot Mobile Robot Revision D 11/17/2005 Table of Contents Introduction Introduction....................................................1 About ARobot................................................1 What You’ll Need..........................................2 Feature List ....................................................2 Specifications.................................................3 Precautions.....................................................4 Component Locator .......................................5 Glossary of Terms..........................................6 Assembly Assembly Overview.......................................9 Parts................................................................10 Painting ..........................................................13 Whiskers ........................................................14 Drive Motor and Brackets..............................16 Encoder Sensor ..............................................17 Front Wheel Assembly ..................................18 Steering Motor and Rear Wheels...................19 Controller Board ............................................21 Battery Pack...................................................22 Body Cable.....................................................23 Finishing Up...................................................24 Usage About the Controller ......................................25
    [Show full text]
  • Optore-16 Optore-16 Standard Standard
    OPTORE-16 OPTORE-16 STANDARD STANDARD EDV-Nr.: A-1222 EDV-No.: A-1222 16 Isolated Digital Inputs 16 Isolated Digital Inputs 16 Reedrelay Outputs 16 Reedrelay Outputs wasco® wasco® user‘s guide user‘s guide wasco® wasco® Copyright© 2006 by Messcomp Datentechnik GmbH Copyright© 2006 by Messcomp Datentechnik GmbH This documentation and the software included with this product are This documentation and the software included with this product are copyright by Messcomp Datentechnik GmbH. All rights are reserved. copyright by Messcomp Datentechnik GmbH. All rights are reserved. Messcomp Datentechnik GmbH reserves the right to modify the products Messcomp Datentechnik GmbH reserves the right to modify the products described in this manual at any time without notice. described in this manual at any time without notice. No parts of this manual are allowed to be reproduced, copied, trans- No parts of this manual are allowed to be reproduced, copied, trans- lated or transmitted in any way without a prior written authorization of lated or transmitted in any way without a prior written authorization of Messcomp Datentechnik GmbH. Messcomp Datentechnik GmbH. Trademarks Trademarks IBM PC, PC/XT and PC/AT are registered trademarks of International IBM PC, PC/XT and PC/AT are registered trademarks of International Business Machines (IBM). Business Machines (IBM). BASIC is registered trademark of Dartmouth College. BASIC is registered trademark of Dartmouth College. Turbo Pascal, Turbo C are registered trademarks of Borland. Turbo Pascal, Turbo C are registered trademarks of Borland. Quickbasic is registered trademark of Microsoft. Quickbasic is registered trademark of Microsoft. Powerbasic is registered trademark of Robert S.
    [Show full text]
  • BASIC Stamp Programming Manual Version 1.9
    ® BASIC Stamp Programming Manual Version 1.9 ® Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply return the product with a description of the problem and a copy of your invoice (if you do not have your invoice, please include your name and telephone number). We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax (for instance, if you ship your product via overnight express, we will do the same). This warranty does not apply if the product has been modified or damaged by accident, abuse, or misuse. 14-Day Money-Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks Copyright © 1998 by Parallax, Inc. All rights reserved. PBASIC is a trademark and Parallax, the Parallax logo, and BASIC Stamp are registered trademarks of Parallax, Inc. PIC is a registered trademark of Microchip Technology, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs or recovering, reprogramming, or reproducing any data stored in or used with Parallax products.
    [Show full text]
  • BASIC Stamp Programming Manual 2.0C · · Page 1 Contents
    BASIC Stamp Ò Programming Manual Version 2.0c Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply call our sales department for an RMA number, write it on the label and return the product with a description of the problem. We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax (for instance, if you ship your product via overnight express, we will do the same). This warranty does not apply if the product has been modified or damaged by accident, abuse, or misuse. 14-Day Money-Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks Copyright © 2000 by Parallax, Inc. All rights reserved. PBASIC is a trademark and BASIC Stamp is a registered trademark or Parallax, Inc. PIC is a registered trademark of Microchip Technology, Inc. Windows is a registered trademark of Microsoft Corporation. 1-wire is a registered trademark of Dallas Semiconductor. Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products.
    [Show full text]
  • Earth Measurements Student Guide for Experiments #1 Through #6
    Earth Measurements Student Guide for Experiments #1 through #6 Version 1.2 Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply call for a Return Merchandise Authorization (RMA) number, write the number on the outside of the box and send it back to Parallax. Please include your name, telephone number, shipping address, and a description of the problem. We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax. 14-Day Money Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund. Parallax will refund the purchase price of the product, excluding shipping / handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks This documentation is copyright 1999 by Parallax, Inc. BASIC Stamp is a registered trademark of Parallax, Inc. If you decided to use the name BASIC Stamp on your web page or in printed material, you must state that "BASIC Stamp is a registered trademark of Parallax, Inc." Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs or recovering, reprogramming, or reproducing any data stored in or used with Parallax products.
    [Show full text]
  • BASIC Stamp I: STAMP.EXE Software Version 2.0 Firmware Version 1.4
    ® BASIC Stamp Programming Manual Version 1.8 ® This manual is valid with the following software and firmware versions: BASIC Stamp I: STAMP.EXE software version 2.0 Firmware version 1.4 BASIC Stamp II: STAMP2.EXE software version 1.1 Firmware version 1.0 Newer versions will usually work, but older versions may not. New software can be obtained for free on our BBS and Internet web and ftp site. New firmware, however, must usually be purchased in the form of a new BASIC Stamp. If you have any questions about what you may need, please contact Parallax. Introduction Thank you for purchasing a BASIC Stamp product. We’ve been making BASIC Stamp computers for years, and most customers find them useful and fun. Of course, we hope your experience with BASIC Stamps will be useful and fun, as well. If you have any questions or need technical assistance, please don’t hesitate to contact Parallax or the distributor from which you purchased your BASIC Stamps. This manual is divided into two sections. The first section deals with the BASIC Stamp I, and the second section deals with the BASIC Stamp II. The BASIC Stamp I has been around for some time, and therefore has more data in the way of application notes. If you have prior experience with BASIC Stamp I, you should consult Appendix C, for details on converting to the Basic Stamp II. PBASIC Language: the BASIC Stamps are programmed in a simple version of the BASIC language, called PBASIC. We developed PBASIC to be easy to understand, yet well-suited for the many control and monitoring applications that BASIC Stamps are used in.
    [Show full text]
  • Embedded Solutions
    EMBEDDED SOLUTIONS Wireless Solutions Boundary Devices . .49 Ackme Networks . 5 Digi International . 51, 52 Anaren . 7, 8 Digilent . .53 Antenova . 5 DLP Design . 54, 55 AMS . .6 EasySync. .56 Bluegiga . 9 FTDI . 57, 58 Digi International . 10, 11 Gravitech . .59 DLP Design . .12 Intel. 50, 60 Freescale. .13 Lantronix . 61, 62 Fujitsu . .13 Leopard Imaging . .48 IDT . 6 Microchip . .50 Laird Technologies . 14, 15 Mide . 63 Linx. 16, 17, 18, 19 MikroElektronika . 64 LS Research . .20 Minnowboard. .48 Maestro Wireless. 6 NetBurner . 65 Micrel. 21, 22 Netduino . 49 Microchip . 23, 24 Pandaboard . .48 Murata Wireless . 25, 26 Parallax. .66 Nordic Semiconductor . 27 Powercast . 50 NXP . 28 Rabbit Semiconductor . 67, 68 Phoenix Contact . 29 Silex . 50 Redpine Signals . 30 Taoglas. 69, 70, 71 RF Digital. .31 Terasic . .72 Silicon Labs . 32, 33 Texas Instruments . .50 Skyetek. .34 STMicroelectronics. .35 Data Acquisition Texas Instruments . 36, 37, 38 Adlink. .73 Wiznet . .39 Advantech . 74, 75, 76, 77 Wurth. .13 Single Board Computers Chipsets Adlink. .78 Intel. .40 Advantech . 79 Arbor . 80 Embedded Modules Axiomtek . 81 Adlink. 41, 42 Congatec . .82 Advantech . 43, 44, 45 Critical Link. .82 Arduino . .46 iBase . 83, 84 B&B Electronics . 47 KA-RO . .85 Beagleboard . .48 Rabbit Semiconductors . 86, 87 WiFi Modules and Chip Antennas Wireless Solutions WALLABY WICED WI-FI NETWORKING MODULES ACKme Networks AMW004 Wallaby WICED Wi-Fi Networking Module is a fully certified small form factor, low power WICED-based Wi-Fi networking module perfectly suited to deeply embedded applications for medium to high volumes. The module runs an embedded TCP/IP networking stack with SSL/TLS/HTTPS security and includes an onboard PCB trace antenna and u.FL connector all in a physical footprint of just 31.2mm x 17.8mm (1.25" x 0.7").
    [Show full text]
  • The Elements of PBASIC Style
    599 Menlo Drive, Suite 100 General: [email protected] Rocklin, California 95765, USA Technical: [email protected] Office: (916) 624-8333 Web Site: www.parallax.com Fax: (916) 624-8003 Educational: www.stampsinclass.com The Elements of PBASIC Style Introduction Like most versions of the BASIC programming language, PBASIC is very forgiving and the compiler enforces no particular formatting style. As long as the source code is syntactically correct, it will compile and download to the BASIC Stamp without trouble. Why, then, would one suggest a specific style for PBASIC? Consider this: Over two million BASIC Stamps have been sold and there are nearly 2500 members of the BASIC Stamp mailing list (on Yahoo! Groups). This makes it highly likely that you'll be sharing your PBASIC code with someone, if not co-developing a BASIC Stamp project. Writing code in an organized, predictable manner will save you – and your potential colleagues – a lot of time; in analysis, in troubleshooting and especially when you return to a project after a long break. The style guidelines presented here are just that: guidelines. They have been developed from style guidelines used by professional programmers using other high-level languages such as Visual Basic®, C/C++, and Java™. Use these guidelines as-is, or modify them to suit your individual needs. The key is selecting a style the works well for you or your organization, and then sticking with it. PBASIC Style Guidelines 1. Do It Right the First Time Many programmers, especially new ones, fall into the "I'll knock it out now and fix it later." trap.
    [Show full text]
  • BASIC Stamp Programming Manual 2.0C · · Page 1 Contents
    BASIC Stamp Ò Programming Manual Version 2.0c Warranty Parallax warrants its products against defects in materials and workmanship for a period of 90 days. If you discover a defect, Parallax will, at its option, repair, replace, or refund the purchase price. Simply call our sales department for an RMA number, write it on the label and return the product with a description of the problem. We will return your product, or its replacement, using the same shipping method used to ship the product to Parallax (for instance, if you ship your product via overnight express, we will do the same). This warranty does not apply if the product has been modified or damaged by accident, abuse, or misuse. 14-Day Money-Back Guarantee If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This does not apply if the product has been altered or damaged. Copyrights and Trademarks Copyright © 2000 by Parallax, Inc. All rights reserved. PBASIC is a trademark and BASIC Stamp is a registered trademark or Parallax, Inc. PIC is a registered trademark of Microchip Technology, Inc. Windows is a registered trademark of Microsoft Corporation. 1-wire is a registered trademark of Dallas Semiconductor. Other brand and product names are trademarks or registered trademarks of their respective holders. Disclaimer of Liability Parallax, Inc. is not responsible for special, incidental, or consequential damages resulting from any breach of warranty, or under any legal theory, including lost profits, downtime, goodwill, damage to or replacement of equipment or property, and any costs of recovering, reprogramming, or reproducing any data stored in or used with Parallax products.
    [Show full text]
  • Robotics with the Boe-Bot Student Guide
    Robotics with the Boe-Bot Student Guide VERSION 3.0 WARRANTY Parallax warrants its products against defects in materials and workmanship for a period of 90 days from receipt of product. If you discover a defect, Parallax will, at its option, repair or replace the merchandise, or refund the purchase price. Before returning the product to Parallax, call for a Return Merchandise Authorization (RMA) number. Write the RMA number on the outside of the box used to return the merchandise to Parallax. Please enclose the following along with the returned merchandise: your name, telephone number, shipping address, and a description of the problem. Parallax will return your product or its replacement using the same shipping method used to ship the product to Parallax. 14-DAY MONEY BACK GUARANTEE If, within 14 days of having received your product, you find that it does not suit your needs, you may return it for a full refund. Parallax will refund the purchase price of the product, excluding shipping/handling costs. This guarantee is void if the product has been altered or damaged. See the Warranty section above for instructions on returning a product to Parallax. COPYRIGHTS AND TRADEMARKS This documentation is Copyright 2003-2010 by Parallax Inc. By downloading or obtaining a printed copy of this documentation or software you agree that it is to be used exclusively with Parallax microcontrollers and products. Any other uses are not permitted and may represent a violation of Parallax copyrights, legally punishable according to Federal copyright or intellectual property laws. Any duplication of this documentation for commercial uses is expressly prohibited by Parallax Inc.
    [Show full text]
  • Physics 517/617 - Experiment 6B Microcomputers
    Physics 517/617 - Experiment 6B Microcomputers Since the Intel 8080 was introduced in 1974 the microprocessor has taken over our lives in many ways. They control hardware from home bread machines to automatic water faucets at airports. A modern car is estimated to have more than thirty monitoring and controlling car functions at all times. Microprocessors are circuit elements that fall between electronic hardware and software. They are computers in that they are programmed using algorithmic languages, but they are hardware in that they are installed by being wired into the system with all of the other electronic components The Basic Stamp II (BS2) is a complete microprocessor (cpu,eeprom,clock...) manufactured by Parallax. Built around the PIC16C57C processor, it is the standard microprocessor used by amateurs and professionals around the U.S.. Parallax simplified the programming by incorporating a basic interpreter in the PIC16C57C rom. The interpreter reads basic commands from an eprom on the StampII. The PIC16C57C has 14 multipurpose programmable input/output pins. The Stamp II is slow (~3000 basic commands/second) but is extremely easy to use. It is programmed through a serial port cable, which can also be used for DAQ. A user-friendly PBASIC compiler/editor/loader is freely available on the Parallax web site. 1) Digital Output: How to get started. An interactive tutorial on your computer (or if you are at home you can install it from the CDROM provided. On the desktop, click on the basic stamp folder. Then click on BS2_Tutorial. You should do the exercises in 3: BASIC Stamp Editor, and 4: Input, Processing, and Output (Here skip the sections on Analog Input: RCTIME and Frequency Output: FREQOUT.
    [Show full text]