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
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.
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
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 boardsArduino, 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
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
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?
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.
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 ToolsBoard 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
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
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???
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
#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.