Microcontroller I Seth Price Department of Chemical Engineering New Mexico Tech Rev. 9/22/14.

Slides:



Advertisements
Similar presentations
EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Advertisements

User-defined Functions Selim Aksoy Bilkent University Department of Computer Engineering
Java Script Session1 INTRODUCTION.
Slide 1CPU Emulator Tutorial This program is part of the software suite that accompanies the book The Digital Core, by Noam Nisan and Shimon Schocken 2003,
Temple University Advisors: Dr. John Helferty Charles Wright Jinyan Chen Billy Cheng Brittany Gray May 12,
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
CS 111: Introduction to Programming Midterm Exam NAME _________________ UIN __________________ 10/30/08 1.Who is our hero? 2.Why is this person our hero?
Flow Charts, Loop Structures
Boe-bots and STEM Boe-bots and STEM – This sectional will introduce participants to a programmable robot that is useful for engaging students in building.
IR Control Materials taken from IR Remote for the Boe-Bot by Andy Lindsay.
Hardware Meets Software CPSC 120 Principles of Computer Science February 15, 2012.
Temple University Advisors: Dr. John Helferty Charles Wright Jinyan Chen Billy Cheng Brittany Gray May 21,
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.
ENGR 101: Robotics Lecture 2 – Text Programming Outline  Introduction to PBASIC  Variables, I/O, Arithmetic  Controlling the LEDs References 
Railway Foundation Electronic, Electrical and Processor Engineering.
Introduction to LabVIEW Seth Price Department of Chemical Engineering New Mexico Tech Rev. 10/5/14.
Promoting Code Reuse Often in programming, multiple procedures will perform the same operation IN OTHER WORDS – the same piece of code will do the same.
MIPS Instruction Set Advantages
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)
MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
Advanced FPGA Based System Design Lecture-9 & 10 VHDL Sequential Code By: Dr Imtiaz Hussain 1.
Python quick start guide
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Control Some Material taken from RobotSubsumption.pdf.
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.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
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.
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.
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.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
1 Chapter 1: Getting Started Presentation based on: "What's a Microcontroller ?" By Andy Lindsay Parallax, Inc Presentation developed by: Martin A. Hebel.
IR Communication October 27, Sources  Lindsay, Andy. IR Remote for the Boe- Bot. v
Slide Menlo Drive Suite 100 Rocklin, CA Presentation based on: “What’s a Microcontroller?" by Andy Lindsay Presented by Andy.
ENGR 101: Robotics Lecture 3 – Robot Motion Outline  Robot Motion  FOR Loops  Making Music References 
ENGR 101: Robotics Lecture 4 – Making Decisions Outline  The Stall Sensor  Making Decisions  Random Number Generation References 
July 7, 2003 Slide 1 of 6 Automation, Robotics and Mechatronics Lab, SUNY at Buffalo Introduction To Programming Chetan Jadhav Talib Bhabharawala Seung-Kook.
1 Parallax BASIC Stamp ® Tutorial Developed by: Electronic Systems Technologies College of Applied Sciences and Arts Southern Illinois University Carbondale.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Slide Menlo Drive Suite 100 Rocklin, CA
Slide 1 Chapter #7: Measuring Light Light Sensor Circuit Parts (1) (1)Resistor – 220 Ω (red-red-brown) (1) Capacitor – 0.1  F (1) Capacitor – 0.01  F.
Digital Electronics Introduction to Microcontrollers and the Board of Education.
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. 
The “Board of Education” 1 Three-position switch 0 = OFF 1 = ON / wheels OFF 2 = ON / wheels ON breadboard (for building circuits) electrical power (V.
Slide Menlo Drive Suite 100 Rocklin, CA
Introduction to Programming Lecture 2
MIPS Instruction Set Advantages
Web Design II Flat Rock Community Schools
Chapter 1: Getting Started
Introduction to Microcontrollers and the Board of Education
BASIC Stamp II Programming for Descartes Robots
Materials taken from IR Remote for the Boe-Bot by Andy Lindsay
Some Material taken from RobotSubsumption.pdf
Programming Boe-Bots (Part 1)
Describe how NASA remotely controls equipment in space.
Registers in the CPU Inside the CPU.
Some Material taken from RobotSubsumption.pdf
Materials taken from IR Remote for the Boe-Bot by Andy Lindsay
Intro to Programming CURIE 2011.
Materials taken from IR Remote for the Boe-Bot by Andy Lindsay
Fevzi Ozaydin & Violet Mwaffo
Programming the BASIC Stamp
Counter Fundamentals Presented by :
Group 7 Ran Wei & Yan Zhang
Presentation transcript:

Microcontroller I Seth Price Department of Chemical Engineering New Mexico Tech Rev. 9/22/14

Microcontrollers Miniature computer for a specific task Also called “embedded system” Examples: microwave, gas pump, alarm clock

BASIC Stamp 2 Microcontroller manufactured by Parallax, Inc. Programmed with a computer using PBASIC

PBASIC Program Format Microcontroller Information – Select “STAMP BS2” – Select “PBASIC Language 2.5 Declarations – Variables and constants Program END Subroutines

PBASIC Variables and Constants Variables must be declared – Variable Name, VAR, Size Variables have different sizes – Bit: a 1 or 0 – Nib: 4 bits – Byte: 8 bits – Word: 16 bits Constants must be declared – Constant Name, CON, Value

PBASIC Commands: DEBUG DEBUG: computer window will display info CR: “Carriage Return” Example Program DEBUG “Hello World!” DEBUG CR DEBUG “Welcome to PBASIC!” END

PBASIC Commands: DO Loop Executes code until a condition is met Format DO….LOOP UNTIL condition Example Program: DO DEBUG “Hello World Forever!” LOOP END

PBASIC Commands: FOR Loop Executes code a set number of times Format: FOR variable = start TO end STEP stepsize – End loop with NEXT Example Program: counter VAR word FOR counter = 1 TO 1000 DEBUG “Hello World!” DEBUG DEC counter NEXT END

PBASIC Variable Size Declaring variables sets aside memory Change “counter VAR word” to “counter VAR Byte” Run the program. What happened?

PBASIC Variable Size “WORD” is 16 bits – Has 2 16 states: to – Represent decimal numbers: 0 to (2 16 ) – 1 – This means: 0 to 65,535 “Byte” is 8 bits – Has 2 8 states: to – Represent decimal numbers: 0 to (2 8 ) – 1 – This means: 0 to 255 Counter “rolls over”, loop never reaches 1000

PBASIC Memory Press F8 to see the RAM Map There are 12 registers (16 bits), meaning: – 12 Words – 24 Bytes – 48 Nibs – 192 Bits

PBASIC Conditionals Can pick which piece of code is executed Format: IF THEN (action) ELSEIF (or ELSE) ENDIF

PBASIC IN and OUT We can pull digital data from the outside world – Format: IN – Example: IF (IN3 = 1) THEN We can push digital data to the outside world – Format: (HIGH or LOW) – Example: HIGH 14