1 / 13

IO in Embedded Systems

IO in Embedded Systems. Martin Schöberl. Overview. Input/Output Digital, Analog Translation Heater control example. Input. Usually simple No or minimal UI Examples Buttons Sensors (e.g. temperature) Camera. Output. Again simple (UI) Output signal needs amplification

kendis
Télécharger la présentation

IO in Embedded Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IO in Embedded Systems Martin Schöberl

  2. Overview • Input/Output • Digital, Analog • Translation • Heater control example Embedded IO

  3. Input • Usually simple • No or minimal UI • Examples • Buttons • Sensors (e.g. temperature) • Camera Embedded IO

  4. Output • Again simple (UI) • Output signal needs amplification • (Solid-state) relays (On/Off) • Pulse-Width Modulation (PWM) • Failure on output? • Broken wire • Read back with an input Embedded IO

  5. Digital IO • 1/0 – On/Off • Represented as electrical value • E.g. 0=0V, 1=5V • Translation to the real world • Contact switches • Relay • Several IO bits/pins in one register Embedded IO

  6. Analog IO • Value range • E.g. -20°C … 100°C • Representation as electrical signal • Voltage e.g. 0-20V • Resistance issue • Current 0-20mA • Industry standard • 4-20mA Value, <4mA broken wire Embedded IO

  7. Analog/Digital Conversion • Electrical signal to digital information • Input: Analog/Digital Converter (ADC) • Output: Digital/Analog Converter (DAC) • Resolution in bits • E.g. 8 bits => 0…255 Embedded IO

  8. Translation Example • -20°C … 100°C => 4mA … 20mA • 0mA … 20mA => 0 … 255 • What value is read at 27°C? • Is the temperature sensor linear? Embedded IO

  9. Control • Read input • Calculate output • Write output • Continue this loop forever Embedded IO

  10. Example: Temperature control For (;;) { int temp = readTemp(); if (temp < 27) { heaterOn = true; } else { heaterOn = false; } setHeater(heaterOn); waitForNextPeriod(); } Embedded IO

  11. Heater Example cont. • What happens around 27°C? • On – Off – On – Off …. • Not so good • Heater does not like this • Relay does not like this • Solution • Hysteresis (two thresholds) Embedded IO

  12. Example: Heater revised for (;;) { int temp = readTemp(); if (temp < 27) { heaterOn = true; } else (temp > 30) { heaterOn = false; } else { // we keep the heater state } setHeater(heaterOn); waitForNextPeriod(); } Embedded IO

  13. Summary • IO is very simple • Translation • Physical world to electrical signals • Electrical signals to digital information • Almost no UI • Control runs in a loop • The control loop Embedded IO

More Related