Programming Boe-Bots (Part 1)

Slides:



Advertisements
Similar presentations
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Advertisements

Lab7: Introduction to Arduino
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Introduction 2 BASIC Stamp®. Microcontrollers Microcontrollers can be thought of as very small computers which may be programmed to control systems such.
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
1 Boe-Bot Parts BOE-BOT Lecture #1b DE - Digital Electronics.
Hardware Meets Software CPSC 120 Principles of Computer Science February 15, 2012.
1 Chapter 1: Getting Started Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
Basic Stamp II is kinda cool Bytes of EEPROM(non-volatile) - Clock speed of 20 MHz. - Holds 600 lines of code in EEPROM - executes an average of.
University of Pennsylvania 1 The BASIC Stamp 2. University of Pennsylvania 2 The BASIC Stamp 2 Serial Signal Conditioning Conditions voltage signals between.
ENGR 101: Robotics Lecture 2 – Text Programming Outline  Introduction to PBASIC  Variables, I/O, Arithmetic  Controlling the LEDs References 
Input and Output Developed by: Electronic Systems Technologies College of Applied Sciences and Arts Southern Illinois University Carbondale
Dr. Hoganson CSIS HC11 Demo Program This is our first lab using the 68HC11 microcontroller. We will “talk” to the microcontroller from a PC, run.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
LSU 06/04/2007BASIC Stamp Editor1 The BASIC Stamp Editor Programming Unit, Lecture 3.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
Basic Stamp Quick Start. Basic Stamp II Self contained computer –“Micro-controller” Specialized for “embedded” computing (sensing and controlling things)
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
PIC microcontrollers. PIC microcontrollers come in a wide range of packages from small chips with only 8 pins and 512 words of memory all the way up to.
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
Parallax BASIC Stamp® Tutorial
BASIC Stamp Editor Once installed, the Stamp Editor will be available on your desktop, and as a menu option under Start  Program Files  Parallax Inc.
A Simple Tour of the MSP430. Light LEDs in C LEDs can be connected in two standard ways. Active high circuit, the LED illuminates if the pin is driven.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Jessica.
The Basic Stamp Instruction Set Architecture. The Microprocessor A microprocessor is a computer that typically has an architecture that is well suited.
MICRO CONTROLLER MODULE 1. Learning Objectives Name some gadgets that use microcontrollers. Define a microcontroller. Differentiate between a computer.
Basic Stamp OEM module By Wilmer Arellano. OEM BASIC Stamp 2sx Wiring diagram Note: - is connection to negative pole of the battery 220 Ohm Push button.
Programming the CheapBot-14. Start the Editor Set the Mode.
10/10/ Controlling YOUR ROBOT. 10/10/2015 Basic Stamp  Basic Stamp Input - output pins Interpreter Chip Power supply: 5 Volts voltage Memory: EEPROM.
Software and documentation Download and install: “Setup-Stamp-Editor-Lrg-v2.2.6.exe”  Downloads  BASIC Stamp software BASIC Stamp Syntax.
Basic Stamp OEM module By Wilmer Arellano. 2  The BASIC Stamp 2 OEM is a discreet component version of the BS2 which may be purchased in kit form. 
1 Chapter 1: Getting Started Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
Microcontroller I Seth Price Department of Chemical Engineering New Mexico Tech Rev. 9/22/14.
Digital Electronics Board-of-Education : Input. Board of Education - Input This presentation will explain, both from a hardware and software perspective,
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
ME456: Mechatronics Prof. Clark J. Radcliffe Mechanical Engineering
1 Chapter 1: Getting Started Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
July 7, 2003 Slide 1 of 6 Automation, Robotics and Mechatronics Lab, SUNY at Buffalo Introduction To Programming Chetan Jadhav Talib Bhabharawala Seung-Kook.
Slide Menlo Drive Suite 100 Rocklin, CA
Digital Electronics Introduction to Microcontrollers and the Board of Education.
ME456:Mechatronics WAM Chapter 1: Getting Started Prof. Clark J. Radcliffe Mechanical Engineering Michigan State University
Basic Stamp OEM module By Wilmer Arellano. 2  The BASIC Stamp 2 OEM is a discreet component version of the BS2 which may be purchased in kit form. 
Digital Electronics Board-of-Education : Output. Board of Education - Output This presentation will explain, both from a hardware and software perspective,
Basic Stamp OEM module By Wilmer Arellano. 2  The BASIC Stamp 2 OEM is a discreet component version of the BS2 which may be purchased in kit form. 
Basic Stamp OEM module By Wilmer Arellano. 2  The BASIC Stamp 2 OEM is a discreet component version of the BS2 which may be purchased in kit form. 
Programming and Debugging with the Dragon and JTAG Many thanks to Dr. James Hawthorne for evaluating the Dragon system and providing the core content for.
Slide Menlo Drive Suite 100 Rocklin, CA
Arduino.
PICAXE Microcontroller
Prototyping with Microcontrollers and Sensors
Programming and Debugging with the Dragon and JTAG
Lab 1: Using NIOS II processor for code execution on FPGA
IR Communication Materials taken from a variety of sources including IR Remote for the Boe-Bot by Andy Lindsay.
Diagram of the Board of Education
Chapter 1: Getting Started
Chapter 1: Getting Started
Introduction to Microcontrollers and the Board of Education
Arduino Part 1 Topics: Microcontrollers Programming Basics
Describe how NASA remotely controls equipment in space.
Controlling YOUR ROBOT
PICAXE BASIC The programming language used by the PICAXE microcontrollers is called BASIC. BASIC is a very early programming language and designed to make.
Fevzi Ozaydin & Violet Mwaffo
Testing 1, 2, 3, testing, testing…
Chapter 1: Getting Started
Programming the BASIC Stamp
Introduction to Arduinos
Introduction to Arduino IDE and Software
I/O Experiments Assignment 1.
Presentation transcript:

Programming Boe-Bots (Part 1) Slides taken from: WAM tutorial, and course material developed by Dean Brock and Tammy Gammon

Module Components Serial Signal Conditioning Conditions voltage signals between PC serial connection (+/- 12V) and BASIC Stamp (5V) for Programming. 5V Regulator Regulates voltage to 5V with a supply of 5.5VDC to 15VDC EEPROM Stores the tokenized PBASIC program. Resonator Sets the speed at which instructions are processed. Interpreter Chip Reads the BASIC program from the EEPROM and executes the instructions.

Module Pins Regulated 5V. Pin 1: SOUT Transmits serial data during programming and using the DEBUG instruction Pin 24: VIN Un-regulated input voltage (5.5-15V) Pin 23: VSS Ground (0V) Pin 2: SIN Receives serial data during programming Pin 22: RES Reset- LOW to reset Pin 3: ATN Uses the serial DTR line to gain the Stamps attention for programming. Pin 21: VDD Regulated 5V. P0 P15 Pins 5-20: Input/Output (I/O) pins P0 through P15 P1 P14 Pin 4: VSS Communications Ground (0V). P2 P13 P3 P12 P4 P11 P5 P10 P6 P9 P7 P8

The Board of Education makes it easy to connect devices, power up and program. 5V regulator Battery Servo Connections Wall DC Supply Power Header Power On Light I/O Header Breadboard Serial Programming Port Reset Switch Off/Module Power/Servo Power

A Simple Program Enter your first program into the BASIC Stamp Editor. Notice that different code appears in different colors. This is a great help in writing correct code!

'Running' Your Program Download, or Run your program by clicking the Run button. The DEBUG Window should appear showing your message.

How a Program is Placed on the Module A program is written in the BASIC Stamp Editor. The program is tokenized, or converted into symbolic format. Tokenizer The tokenized program is transmitted through the serial cable and stored in EEPROM memory. The Interpreter Chip reads the program from EEPROM and executes the instructions.

Directives Directives are special instructions to the Editor ensuring the the code is tokenized for the correct PBASIC version and for the correct BASIC Stamp. When starting a new program, be sure to click the buttons to add these directives to your program.

Hello, it's me, your BASIC Stamp! DEBUG Window When a program contains a DEBUG command, the Editor opens the DEBUG Window. Hello, it's me, your BASIC Stamp! Data is sent back through the serial cable as characters to be viewed. This data is sent very quickly! The RESET button on board will start the program on your Stamp again.

Getting Help

Program like you are an engineer Organize and structure your code. Use indentation to clarify organization. Indent loops and code skipped by if’s Use white space wisely. Follow a consistent style and format. Use comments to explain your code. input 14 ‘push button – normal timing Use variable and loop names which clarify purpose.

The Program Header Identify the code. Briefly state purpose of code. Your name Project Title Date Title/file of code Briefly state purpose of code.

Good Program Structure Header Define the constants green con 0 “Declare” the pins input 14 ‘push button for normal timing output green ‘green LED Declare and comment your variables n var byte ‘index for varying blink rate

I/O Pin “Language” input 14 ‘normal mode pushbutton if in14 then …… output 0 ‘green led out0 = 0 pause 500 out0 = 1 You don’t even have to declare output: low green pause 500 high green

Declaring & Assigning Variables A variable & its size must be declared: normal var bit ‘allocates 1 bit (0 or 1) x var nib ‘nibble, 4 bits (0 – 15) y var byte ‘byte, 8 bits (0 – 255) counter var word ‘16 bits (0 – 65,535) Variables contain values which can be changed. Examples: normal = in14 normal = ~normal counter = counter + 1

If …. then Function Arithmetic and logical operators may be used in the test condition. A bit of code… if in14 = 0 then normal_mode if in14 = 0 and in7 = 0 then non_resp Why wouldn’t you want to list if…then statements as shown?

For….next Iterative loop Example to create varying pause times: x var nib for x = 1 to 10 … pause 200 * x next

Of course, we must mention… goto label ‘creates continuous loop ‘or skips to another part of program And all happily ever-afters finish with a “the end” or just END in PBASIC.

Sensors A microcontroller-controlled system changes its outputs according to its input signals A sensor is an input device used to detect or measure. Example: push-button

Push-Button Sensor OPEN (Not pressed) CLOSED (Pressed)

Push-Button Sensor

Sample Code input 2 ‘push button recheck: if in2 = 0 then blink goto recheck blink: …make some led blink