Movatterモバイル変換


[0]ホーム

URL:


Uploaded byacloudinfo2023
PPTX, PDF52 views

embedded_in_Arduino_with_basic_embedded.pptx

Basic of Embedded C in Arduino

Embed presentation

Download to read offline
EMBEDDED SYSTEMWITH ARDUINO
Embedded System Is a special purpose system designed to perform afew dedicated functions. Small foot prints (in memory) Highly optimized code Cell phones, mp3 players are examples. The components in an mp3 player are highlyoptimized for storage operations. (For example, noneed to have a floating point operation on an mp3player!)04/29/20252
Introduction
Definition A combination of hardware and software whichtogether form a component of a larger machine. An example of an embedded system is amicroprocessor that controls an automobile engine. An embedded system is designed to run on its ownwithout human intervention, and may be requiredto respond to events in real time.
Processor BasicsALURegistersControlUnitCPUMemoryPeripheralsMCUSoCBus
What is aMicrocontroller• A small computer on asingle chip• containing aprocessor, memory,and input/output• Typically, "embedded"inside some device thatthey control• A microcontroller isoften small and low costwww.mikroe.com/chapters/view/1
Microcontroller Processor – Instruction Set + memory + accelerators Ecosystem Memory Non-Volatileo ROMo EPROM, EEPROM, Flash Volatileo RAM (DRAM, SRAM) Interfaces H/W: Ports S/W: Device Driver Parallel, Serial, Analog, Time I/O Memory-mapped vs. I/O-instructions (I/O-mapped)
Done• Hardware• Software• Specifications• ConstraintsAnalyzetheproblemRequirementsDesignConstraintsTesting• Block diagrams• Data flow graphsDeploymentNew requirementsNew constraintsDevelopmentProduct Life CycleAnalysis (What?)Requirements -> SpecificationsDesign (How?)High-Level: Block DiagramsEngineering: Algorithms, DataStructures, InterfacingImplementation(Real)Hardware, SoftwareTesting (Works?)Validation: CorrectnessPerformance: EfficiencyMaintenance (Improve)
What is a Development Board A development board is a small, pre-designed circuit boardwith a microcontroller or microprocessor. It's used to develop, test, and prototype electronic devicesand systems. What it's used for Learning: For beginners and experts to build circuits andsystems Prototyping: To test circuit designs and validate theories Industrial applications: To create smart home solutions, such aslighting, heating, and security systems Internet of Things (IoT): To receive, monitor, analyze, andrecord sensor signals
Popular development boards Arduino, Raspberry Pi, Intel Edison, Intel Galileo, Node MCU, E-health shield, Atmega328p MC.
Why Was Arduino Developed? Physical Computing – using components that can interact withpeople and with the world around us The Arduino was originally developed for artists and designers toprototype interactive displays Developed for non-scientists Minimalist programming “Forgiving” circuitry that can handle a wide variety of wiringerrors
The Arduino Development Board
The Arduino Microcontroller: Atmel ARV Atmega328
What is the Arduinotodbot.com/blog/bionicarduino
Try It: Connect the USB Cable
Arduino IDE
Select Serial Port and Board
Status Messages
todbot.com/blog/bionicarduino
Different Varieties of Arduino
What Can Arduino Uno Be Used To Teach? Introductory electronics (voltage, current, resistance) How sensors and actuators work Rudimentary programming Design of basic scientific equipment Troubleshooting Challenges of communicating with users through a project (e.g.,messages, formatting numbers, ease of use, etc.) Statistics and variation in data gathering
Continuity – Is it a Circuit?The word “circuit” is derived from the circle.An Electrical Circuit must have a continuousLOOP from Power (Vcc) to Ground (GND).Continuity is important to make portions ofcircuits are connect. Continuity is thesimplest and possibly the most importantsetting on your multi-meter. Sometimes wecall this “ringing out” a circuit.
Measuring Electricity – VoltageVoltage is a measure of potentialelectrical energy. A voltage isalso called a potential difference– it is measured between twopoints in a circuit – across adevice.
Measuring Electricity -- CurrentCurrent is the measure of the rate ofcharge flow. For Electrical Engineers –we consider this to be the movementof electrons.In order to measure this – you must breakthe circuit or insert the meter in-line(series).
Measuring Electricity --ResistanceResistance is the measure of how muchopposition to current flow is in a circuit.Components should be removed entirelyfrom the circuit to measure resistance.Note the settings on the multi-meter.Make sure that you are set for theappropriate range.Resistancesettings
Prototyping CircuitsSolderless BreadboardOne of the most useful tools in anengineer or Maker’s toolkit. Thethree most important things:• A breadboard is easier than soldering• A lot of those little holes are connected, whichones?• Sometimes breadboards break
What’s a Breadboard?
Solderless BreadboardEach row (horiz.) of 5 holes areconnected.Vertical columns – called powerbus are connected vertically
Using the Breadboard to built a simple circuitUse the breadboard to wire upa single LED with a 330 OhmResistor (Orange-Orange-Brown).Note: the longer leg on the LED isthe positive leg and the shorterleg is the negative
Fritzing View of BreadboardCircuitWhat happens whenyou break thecircuit?What if you wantedto add more thanone LED?
Adding control – let’s use the Arduinoand start programming!!!
Concepts: INPUT vs. OUTPUTInputs is a signal / informationgoing into the board.Output is any signal exiting theboard.Almost all systems that use physical computing will have some form ofoutput
Concepts: INPUT vs. OUTPUTExamples: Buttons Switches,Light Sensors, Flex Sensors,Humidity Sensors,Temperature Sensors…Examples: LEDs, DC motor,servo motor, a piezo buzzer,relay, an RGB LED
Concepts: Analog vs. DigitalMicrocontrollers are digital devices – ON or OFF. Also called – discrete.analog signals are anything that can be a full range of values. What aresome examples? More on this later…5 V0 V5 V0 V
Open up ArduinoHints:For PC Users 1.Let the installer copy andmove the files to theappropriate locations, or2.Create a folder under C:Program Files (x86) calledArduino. Move the entireArduino program folderhere.For Mac Users 1. Move the Arduinoexecutable to thedock for ease ofaccess.2. Resist the temptationto run these fromyour desktop.
ArduinoIntegrated Development Environment (IDE)Two required functions /methods / routines:void setup(){// runs once}void loop(){// repeats}error & status messages
Settings: Tools  Serial PortYour computercommunicates to theArduino microcontroller viaa serial port  through aUSB-Serial adapter.Check to make sure thatthe drivers are properlyinstalled.
Settings: Tools  BoardNext, double-check that the proper board is selectedunder the ToolsBoard menu.
What Are Some Good Components to Start With? LEDs….lots of LEDs with varietyof colors (be sure to alsoacquire lots of current-limitingresistors) Good for blinking, dimmingusing PWM, “Knight Rider”effect with 8 or more LEDs,strobe effects, etc.
What Are Some Good Components to Start With? LCD Screen with backlight (16x2 is common and teaches thecomplications of textual display) The parallel version uses 4 digital pins for display Instructions for how to connect is built in as a sample “sketch” in theArduino Students get a huge degree of satisfaction from transmitting text to theLCD screen
Current-limitingresistors for RGBbacklight10 kWpotentiometer toadjust screencontrast
What Are Some Good Components to Start With? Basic temperature and/or humidity sensor DHT11 or DHT22 is a good entry-level choice Library can be downloaded and incorporated to give easy access tofeatures of the sensor
Current-limitingresistors for RGBbacklightDHT 11 Sensor
What Are Some Good Components to Start With? Small servos Arduino can be used to position servoat a given angle for use in projects. Other sensors can be attached to theservo to add a layer of complexity Servo library included in Arduino IDE
What Are Some Good Components to Start With? Ultrasonic Ranger – uses ultrasonic waves to determine the distancebetween sensor and object based on time between emission of waveand echo of it. Good for introducing discussion of speed of sound variation withenvironmental conditions Calibration principles are easily discussed
What Are Some Other ComponentsThat Are Relatively Easy to Use? GPS Module that can be used for a variety of purposessuch as triggering a response only when the user isstanding in a particular location
What Are Some Other ComponentsThat Are Relatively Easy to Use? Mechanical orSolid-StateRelay Boards tocontrolalternatingcurrent loads ofseveral amps
Let’s get to coding…Project #1 – Blink“Hello World” of Physical ComputingPsuedo-code – how should this work?Turn LEDONWaitTurn LEDOFFWaitRinse &Repeat
Project #1: Wiring DiagramMove the greenwire from thepower bus to pin13 (or any otherDigital I/O pin onthe Arduinoboard.Image created inFritzing
A few simple challengesLet’s make LED#13 blink!Challenge 1a – blink with a 200 ms second interval.Challenge 1b – blink to mimic a heartbeatChallenge 1c – find the fastest blink that the humaneye can still detect…1 ms delay? 2 ms delay? 3 ms delay???
Try adding other LEDs
Programming Concepts: VariablesGlobal---Function-levelVariable Scope
Programming Concepts: Variable TypesVariable Types:8 bits 16 bits 32 bitsbytecharintunsigned intlongunsignedlongfloat
Fading in and Fading Out(Analog or Digital?)A few pins on the Arduino allow for us to modify theoutput to mimic an analog signal.This is done by a technique called:Pulse Width Modulation (PWM)
Concepts: Analog vs. DigitalPulse Width Modulation (PWM)To create an analog signal, the microcontroller uses a technique calledPWM. By varying the duty cycle, we can mimic an “average” analogvoltage.
Project #2 – FadingIntroducing a new command…analogWrite(pin, val);pin – refers to the OUTPUT pin(limited to pins 3, 5, 6, 9, 10,11.) – denoted by a ~ symbolval – 8 bit value (0 – 255).0 => 0V | 255 => 5V
Move one of your LED pins over to Pin 9In Arduino, open up:File  Examples  01.Basics  Fade
Fade - Code Review
Fade - Code Review

Recommended

PDF
Arduino Workshop Day 1 - Basic Arduino
 
PPT
computer_programming for grade 12 learners
PPT
Arduino basics presenation - basics to .
PPTX
Ardui no
PDF
arduinoworkshop-160204051621.pdf
PPTX
QuickIntroduction to Arduino and Sensors
PPTX
Basic arduino components and more things about arduino
PPTX
Intro_to_Arduino_-_v30.pptx
PPT
Intro to Arduino
PPTX
Arduino slides
PPTX
arduino and its introduction deep dive ppt.pptx
PDF
Arduino - Learning.pdf
PPTX
Arduino Workshop Slides
PPTX
Introduction to the Arduino
PPT
Introduction to Arduino - Basics programming
PDF
Intro_to_Arduino_-_v30_1.pdf
PPT
Arduino uno basics with pin diagram program
PDF
02 Sensors and Actuators Understand .pdf
PDF
Getting startedwitharduino ch04
PDF
introductiontoarduino-111120102058-phpapp02.pdf
PPTX
Intro_to_Arduino_Full_ppt_with_examples_and_excersices
PPTX
Arduino Programming Familiarization
PPTX
Introduction To Arduino-converted for s.pptx
 
PDF
Oop 2014 embedded systems with open source hardware v2
PDF
Intro_to_AFrduinoFFFFFFFFFFF_-_v30_1.pdf
PPTX
Arduino_Beginner.pptx
PDF
Making things sense - Day 1 (May 2011)
DOCX
iRobot Post‑Mortem and Alternative Paths - Discussion Document for Boards and...
PDF
Security Forum Sessions from Houston 2025 Event

More Related Content

PDF
Arduino Workshop Day 1 - Basic Arduino
 
PPT
computer_programming for grade 12 learners
PPT
Arduino basics presenation - basics to .
PPTX
Ardui no
PDF
arduinoworkshop-160204051621.pdf
PPTX
QuickIntroduction to Arduino and Sensors
PPTX
Basic arduino components and more things about arduino
PPTX
Intro_to_Arduino_-_v30.pptx
Arduino Workshop Day 1 - Basic Arduino
 
computer_programming for grade 12 learners
Arduino basics presenation - basics to .
Ardui no
arduinoworkshop-160204051621.pdf
QuickIntroduction to Arduino and Sensors
Basic arduino components and more things about arduino
Intro_to_Arduino_-_v30.pptx

Similar to embedded_in_Arduino_with_basic_embedded.pptx

PPT
Intro to Arduino
PPTX
Arduino slides
PPTX
arduino and its introduction deep dive ppt.pptx
PDF
Arduino - Learning.pdf
PPTX
Arduino Workshop Slides
PPTX
Introduction to the Arduino
PPT
Introduction to Arduino - Basics programming
PDF
Intro_to_Arduino_-_v30_1.pdf
PPT
Arduino uno basics with pin diagram program
PDF
02 Sensors and Actuators Understand .pdf
PDF
Getting startedwitharduino ch04
PDF
introductiontoarduino-111120102058-phpapp02.pdf
PPTX
Intro_to_Arduino_Full_ppt_with_examples_and_excersices
PPTX
Arduino Programming Familiarization
PPTX
Introduction To Arduino-converted for s.pptx
 
PDF
Oop 2014 embedded systems with open source hardware v2
PDF
Intro_to_AFrduinoFFFFFFFFFFF_-_v30_1.pdf
PPTX
Arduino_Beginner.pptx
PDF
Making things sense - Day 1 (May 2011)
Intro to Arduino
Arduino slides
arduino and its introduction deep dive ppt.pptx
Arduino - Learning.pdf
Arduino Workshop Slides
Introduction to the Arduino
Introduction to Arduino - Basics programming
Intro_to_Arduino_-_v30_1.pdf
Arduino uno basics with pin diagram program
02 Sensors and Actuators Understand .pdf
Getting startedwitharduino ch04
introductiontoarduino-111120102058-phpapp02.pdf
Intro_to_Arduino_Full_ppt_with_examples_and_excersices
Arduino Programming Familiarization
Introduction To Arduino-converted for s.pptx
 
Oop 2014 embedded systems with open source hardware v2
Intro_to_AFrduinoFFFFFFFFFFF_-_v30_1.pdf
Arduino_Beginner.pptx
Making things sense - Day 1 (May 2011)

Recently uploaded

DOCX
iRobot Post‑Mortem and Alternative Paths - Discussion Document for Boards and...
PDF
Security Forum Sessions from Houston 2025 Event
PDF
Eredità digitale sugli smartphone: cosa resta di noi nei dispositivi mobili
PPTX
Conversational Agents – Building Intelligent Assistants [Virtual Hands-on Wor...
PDF
Day 2 - Network Security ~ 2nd Sight Lab ~ Cloud Security Class ~ 2020
PPTX
THIS IS CYBER SECURITY NOTES USED IN CLASS ON VARIOUS TOPICS USED IN CYBERSEC...
PDF
Access Control 2025: From Security Silo to Software-Defined Ecosystem
PPTX
Building Cyber Resilience for 2026: Best Practices for a Secure, AI-Driven Bu...
PDF
Is It Possible to Have Wi-Fi Without an Internet Provider
PPTX
Cybersecurity Best Practices - Step by Step guidelines
PDF
Day 1 - Cloud Security Strategy and Planning ~ 2nd Sight Lab ~ Cloud Security...
PDF
Our Digital Tribe_ Cultivating Connection and Growth in Our Slack Community 🌿...
PDF
Unser Jahresrückblick – MarvelClient in 2025
PPTX
From Backup to Resilience: How MSPs Are Preparing for 2026
 
PPTX
Protecting Data in an AI Driven World - Cybersecurity in 2026
PPTX
Chapter 3 Introduction to number system.pptx
PDF
Usage Control for Process Discovery through a Trusted Execution Environment
PPTX
cybercrime in Information security .pptx
PPTX
Cybercrime in the Digital Age: Risks, Impact & Protection
PDF
TrustArc Webinar - Looking Ahead: The 2026 Privacy Landscape
iRobot Post‑Mortem and Alternative Paths - Discussion Document for Boards and...
Security Forum Sessions from Houston 2025 Event
Eredità digitale sugli smartphone: cosa resta di noi nei dispositivi mobili
Conversational Agents – Building Intelligent Assistants [Virtual Hands-on Wor...
Day 2 - Network Security ~ 2nd Sight Lab ~ Cloud Security Class ~ 2020
THIS IS CYBER SECURITY NOTES USED IN CLASS ON VARIOUS TOPICS USED IN CYBERSEC...
Access Control 2025: From Security Silo to Software-Defined Ecosystem
Building Cyber Resilience for 2026: Best Practices for a Secure, AI-Driven Bu...
Is It Possible to Have Wi-Fi Without an Internet Provider
Cybersecurity Best Practices - Step by Step guidelines
Day 1 - Cloud Security Strategy and Planning ~ 2nd Sight Lab ~ Cloud Security...
Our Digital Tribe_ Cultivating Connection and Growth in Our Slack Community 🌿...
Unser Jahresrückblick – MarvelClient in 2025
From Backup to Resilience: How MSPs Are Preparing for 2026
 
Protecting Data in an AI Driven World - Cybersecurity in 2026
Chapter 3 Introduction to number system.pptx
Usage Control for Process Discovery through a Trusted Execution Environment
cybercrime in Information security .pptx
Cybercrime in the Digital Age: Risks, Impact & Protection
TrustArc Webinar - Looking Ahead: The 2026 Privacy Landscape

embedded_in_Arduino_with_basic_embedded.pptx

  • 1.
  • 2.
    Embedded System Isa special purpose system designed to perform afew dedicated functions. Small foot prints (in memory) Highly optimized code Cell phones, mp3 players are examples. The components in an mp3 player are highlyoptimized for storage operations. (For example, noneed to have a floating point operation on an mp3player!)04/29/20252
  • 3.
  • 4.
    Definition A combinationof hardware and software whichtogether form a component of a larger machine. An example of an embedded system is amicroprocessor that controls an automobile engine. An embedded system is designed to run on its ownwithout human intervention, and may be requiredto respond to events in real time.
  • 5.
  • 6.
    What is aMicrocontroller•A small computer on asingle chip• containing aprocessor, memory,and input/output• Typically, "embedded"inside some device thatthey control• A microcontroller isoften small and low costwww.mikroe.com/chapters/view/1
  • 7.
    Microcontroller Processor –Instruction Set + memory + accelerators Ecosystem Memory Non-Volatileo ROMo EPROM, EEPROM, Flash Volatileo RAM (DRAM, SRAM) Interfaces H/W: Ports S/W: Device Driver Parallel, Serial, Analog, Time I/O Memory-mapped vs. I/O-instructions (I/O-mapped)
  • 8.
    Done• Hardware• Software•Specifications• ConstraintsAnalyzetheproblemRequirementsDesignConstraintsTesting• Block diagrams• Data flow graphsDeploymentNew requirementsNew constraintsDevelopmentProduct Life CycleAnalysis (What?)Requirements -> SpecificationsDesign (How?)High-Level: Block DiagramsEngineering: Algorithms, DataStructures, InterfacingImplementation(Real)Hardware, SoftwareTesting (Works?)Validation: CorrectnessPerformance: EfficiencyMaintenance (Improve)
  • 9.
    What is aDevelopment Board A development board is a small, pre-designed circuit boardwith a microcontroller or microprocessor. It's used to develop, test, and prototype electronic devicesand systems. What it's used for Learning: For beginners and experts to build circuits andsystems Prototyping: To test circuit designs and validate theories Industrial applications: To create smart home solutions, such aslighting, heating, and security systems Internet of Things (IoT): To receive, monitor, analyze, andrecord sensor signals
  • 10.
    Popular development boardsArduino, Raspberry Pi, Intel Edison, Intel Galileo, Node MCU, E-health shield, Atmega328p MC.
  • 11.
    Why Was ArduinoDeveloped? Physical Computing – using components that can interact withpeople and with the world around us The Arduino was originally developed for artists and designers toprototype interactive displays Developed for non-scientists Minimalist programming “Forgiving” circuitry that can handle a wide variety of wiringerrors
  • 12.
  • 13.
    The Arduino Microcontroller:Atmel ARV Atmega328
  • 14.
    What is theArduinotodbot.com/blog/bionicarduino
  • 15.
    Try It: Connectthe USB Cable
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
    What Can ArduinoUno Be Used To Teach? Introductory electronics (voltage, current, resistance) How sensors and actuators work Rudimentary programming Design of basic scientific equipment Troubleshooting Challenges of communicating with users through a project (e.g.,messages, formatting numbers, ease of use, etc.) Statistics and variation in data gathering
  • 22.
    Continuity – Isit a Circuit?The word “circuit” is derived from the circle.An Electrical Circuit must have a continuousLOOP from Power (Vcc) to Ground (GND).Continuity is important to make portions ofcircuits are connect. Continuity is thesimplest and possibly the most importantsetting on your multi-meter. Sometimes wecall this “ringing out” a circuit.
  • 23.
    Measuring Electricity –VoltageVoltage is a measure of potentialelectrical energy. A voltage isalso called a potential difference– it is measured between twopoints in a circuit – across adevice.
  • 24.
    Measuring Electricity --CurrentCurrent is the measure of the rate ofcharge flow. For Electrical Engineers –we consider this to be the movementof electrons.In order to measure this – you must breakthe circuit or insert the meter in-line(series).
  • 25.
    Measuring Electricity --ResistanceResistanceis the measure of how muchopposition to current flow is in a circuit.Components should be removed entirelyfrom the circuit to measure resistance.Note the settings on the multi-meter.Make sure that you are set for theappropriate range.Resistancesettings
  • 26.
    Prototyping CircuitsSolderless BreadboardOneof the most useful tools in anengineer or Maker’s toolkit. Thethree most important things:• A breadboard is easier than soldering• A lot of those little holes are connected, whichones?• Sometimes breadboards break
  • 27.
  • 28.
    Solderless BreadboardEach row(horiz.) of 5 holes areconnected.Vertical columns – called powerbus are connected vertically
  • 29.
    Using the Breadboardto built a simple circuitUse the breadboard to wire upa single LED with a 330 OhmResistor (Orange-Orange-Brown).Note: the longer leg on the LED isthe positive leg and the shorterleg is the negative
  • 30.
    Fritzing View ofBreadboardCircuitWhat happens whenyou break thecircuit?What if you wantedto add more thanone LED?
  • 31.
    Adding control –let’s use the Arduinoand start programming!!!
  • 32.
    Concepts: INPUT vs.OUTPUTInputs is a signal / informationgoing into the board.Output is any signal exiting theboard.Almost all systems that use physical computing will have some form ofoutput
  • 33.
    Concepts: INPUT vs.OUTPUTExamples: Buttons Switches,Light Sensors, Flex Sensors,Humidity Sensors,Temperature Sensors…Examples: LEDs, DC motor,servo motor, a piezo buzzer,relay, an RGB LED
  • 34.
    Concepts: Analog vs.DigitalMicrocontrollers are digital devices – ON or OFF. Also called – discrete.analog signals are anything that can be a full range of values. What aresome examples? More on this later…5 V0 V5 V0 V
  • 35.
    Open up ArduinoHints:ForPC Users 1.Let the installer copy andmove the files to theappropriate locations, or2.Create a folder under C:Program Files (x86) calledArduino. Move the entireArduino program folderhere.For Mac Users 1. Move the Arduinoexecutable to thedock for ease ofaccess.2. Resist the temptationto run these fromyour desktop.
  • 36.
    ArduinoIntegrated Development Environment(IDE)Two required functions /methods / routines:void setup(){// runs once}void loop(){// repeats}error & status messages
  • 37.
    Settings: Tools Serial PortYour computercommunicates to theArduino microcontroller viaa serial port  through aUSB-Serial adapter.Check to make sure thatthe drivers are properlyinstalled.
  • 38.
    Settings: Tools BoardNext, double-check that the proper board is selectedunder the ToolsBoard menu.
  • 39.
    What Are SomeGood Components to Start With? LEDs….lots of LEDs with varietyof colors (be sure to alsoacquire lots of current-limitingresistors) Good for blinking, dimmingusing PWM, “Knight Rider”effect with 8 or more LEDs,strobe effects, etc.
  • 40.
    What Are SomeGood Components to Start With? LCD Screen with backlight (16x2 is common and teaches thecomplications of textual display) The parallel version uses 4 digital pins for display Instructions for how to connect is built in as a sample “sketch” in theArduino Students get a huge degree of satisfaction from transmitting text to theLCD screen
  • 41.
    Current-limitingresistors for RGBbacklight10kWpotentiometer toadjust screencontrast
  • 42.
    What Are SomeGood Components to Start With? Basic temperature and/or humidity sensor DHT11 or DHT22 is a good entry-level choice Library can be downloaded and incorporated to give easy access tofeatures of the sensor
  • 43.
  • 44.
    What Are SomeGood Components to Start With? Small servos Arduino can be used to position servoat a given angle for use in projects. Other sensors can be attached to theservo to add a layer of complexity Servo library included in Arduino IDE
  • 45.
    What Are SomeGood Components to Start With? Ultrasonic Ranger – uses ultrasonic waves to determine the distancebetween sensor and object based on time between emission of waveand echo of it. Good for introducing discussion of speed of sound variation withenvironmental conditions Calibration principles are easily discussed
  • 46.
    What Are SomeOther ComponentsThat Are Relatively Easy to Use? GPS Module that can be used for a variety of purposessuch as triggering a response only when the user isstanding in a particular location
  • 47.
    What Are SomeOther ComponentsThat Are Relatively Easy to Use? Mechanical orSolid-StateRelay Boards tocontrolalternatingcurrent loads ofseveral amps
  • 48.
    Let’s get tocoding…Project #1 – Blink“Hello World” of Physical ComputingPsuedo-code – how should this work?Turn LEDONWaitTurn LEDOFFWaitRinse &Repeat
  • 49.
    Project #1: WiringDiagramMove the greenwire from thepower bus to pin13 (or any otherDigital I/O pin onthe Arduinoboard.Image created inFritzing
  • 50.
    A few simplechallengesLet’s make LED#13 blink!Challenge 1a – blink with a 200 ms second interval.Challenge 1b – blink to mimic a heartbeatChallenge 1c – find the fastest blink that the humaneye can still detect…1 ms delay? 2 ms delay? 3 ms delay???
  • 51.
  • 52.
  • 53.
    Programming Concepts: VariableTypesVariable Types:8 bits 16 bits 32 bitsbytecharintunsigned intlongunsignedlongfloat
  • 54.
    Fading in andFading Out(Analog or Digital?)A few pins on the Arduino allow for us to modify theoutput to mimic an analog signal.This is done by a technique called:Pulse Width Modulation (PWM)
  • 55.
    Concepts: Analog vs.DigitalPulse Width Modulation (PWM)To create an analog signal, the microcontroller uses a technique calledPWM. By varying the duty cycle, we can mimic an “average” analogvoltage.
  • 56.
    Project #2 –FadingIntroducing a new command…analogWrite(pin, val);pin – refers to the OUTPUT pin(limited to pins 3, 5, 6, 9, 10,11.) – denoted by a ~ symbolval – 8 bit value (0 – 255).0 => 0V | 255 => 5V
  • 57.
    Move one ofyour LED pins over to Pin 9In Arduino, open up:File  Examples  01.Basics  Fade
  • 58.
  • 59.

Editor's Notes

  • #7 ProcessorThere are two classifications of computers: complex instruction set computer (CISC) and reduced instruction set computer (RISC). In reality, there is a spectrum of architectures that we can classify as CISC or RISC. We make these general observations when deciding whether to call a computer CISC or RISC:Complex instruction set computers (CISC)Early computers offered CPUs that were much faster than available memories.Fetching instructions limited performanceA single complex instruction could perform many operationsExample: Find the zeros of a polynomialComplex instructions require many processor clock cycles to complete and most instructions can access memoryA program running on a CISC computer employed a relatively small number of complex instructionsHigh code density, many instruction types w/ varying length, fewer and specialized registers, many addressing modesComplexity is embedded in the processor hardware (overhead)Examples: Intel (x86), Freescale 9S12Reduced Instruction Set Computers (RISC)Memories match CPU speedNo large penalty for instruction fetchInstructions simplifiedExample: dedicated load/store instructions, regular instructions can not access memory but only registersSingle processor clock cycle per instruction (pipelined)A program running on a RISC computer employs a relatively larger number of simplified instructionsReduced code density, few instructions w/ fixed delay (pipeline!), many identical general-purpose registers, few addressing modesComplexity exists in the assembly code generated by the programmer or compiler, hardware is simple (low overhead/low power)Examples: LC3, MIPS, ARM, SPARC, PowerPCWhich architecture is best is beyond the scope of this class, but it is important to recognize the terminology. It is very difficult to compare the execution speed of two computers, especially between a CISC and a RISC. One way to compare is to run a benchmark program on both, and measure the time it takes to execute.Time to execute benchmark = Instructions/program * Average cycles/instruction * Seconds/cycle For example, the 50 MHz ARM Cortex M has one bus cycle every 20ns. One average it may require 1.5 cycles per instruction. If the benchmark program executes 10,000,000 assembly instructions, then the time to execute the benchmark will be 0.3 seconds.Memory: EPROMs are Erasable Programmable ROMs. The mechanism used to erase and write is UV light EEPROMs are Electrically Erasable Flash memory is like EEPROM however writes are performed in large blocks as opposed to single bytes. Cheaper hence popular DRAMs require a periodic refresh SRAMs don’t. Both are volatile therefore are lost when powered down.Interfaces:Parallel - binary data is available simultaneously on groups of linesSerial - binary data is available one bit at a time on a single lineAnalog - data is encoded as a variable voltageTime - data is encoded as a period, frequency, pulse width or phase shiftI/OMemory-mapped I/OI/O ports/registers appear as addresses on common bus with memoryI/O ports/registers are accessed as though they are locations in memoryEmployed on the ARM, Freescale and TI processors I/O-mapped I/OI/O ports/registers have separate control signals from those used with memorySpecial instructions are used to access I/O ports/registersEmployed on Intel x86 processors
  • #8 Requirements are broad and Specifications go into the details.
  • #36 Be sure to point out the what all of the buttons do.
  • #37 All connections to computers- mice, printers etc use a serial port. Gotta pick the right one.
  • #38 All connections to computers- mice, printers etc use a serial port. Gotta pick the right one.

[8]ページ先頭

©2009-2025 Movatter.jp