Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers....
Transcript of Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers....
![Page 1: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/1.jpg)
Embedded SystemsEmbedded Systemsand Microcontrollersand Microcontrollers
![Page 2: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/2.jpg)
What is anWhat is anembedded system?embedded system?
![Page 3: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/3.jpg)
DefinitionDefinitionAn embedded system is a computer system with a dedicated function within a largermechanical or electrical system, often withreal-time computing constraints. Itis embedded as part of a complete deviceoften including hardware and mechanicalparts. Embedded systems control manydevices in common use today.(https://en.wikipedia.org/wiki/Embedded_system)
![Page 4: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/4.jpg)
Embedded systems control manyEmbedded systems control many
devices in common use today...devices in common use today...
![Page 5: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/5.jpg)
How many CPU's in this picture?How many CPU's in this picture?Car seat from a2004 trade show
![Page 6: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/6.jpg)
How many CPU's in this picture?How many CPU's in this picture?Car seat from a2004 trade show
And this is just theseat adjustment...
![Page 7: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/7.jpg)
Example car network:Example car network:
![Page 8: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/8.jpg)
2013:8 bit: 6.7 B16 bit: 7.8 B32 bit: 4.2 B
![Page 9: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/9.jpg)
Why should youWhy should youcare?care?
![Page 10: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/10.jpg)
A growing embedded worldA growing embedded world
More products arebecoming "smart" and"connected" and all of thecompanies developingthem are looking forpeople who know how todevelop for embeddedsystems.
![Page 11: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/11.jpg)
A practical skillA practical skillDIY projects usually aren't done with a laptop attached to everything.
![Page 12: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/12.jpg)
Parts of anParts of anembedded systemembedded system
![Page 13: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/13.jpg)
One look at an embedded systemOne look at an embedded system
![Page 14: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/14.jpg)
ImportantlyImportantlyCPUInputOutputMemory
![Page 15: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/15.jpg)
CPUsCPUsA quick tour of popularA quick tour of popular
microcontrollers and other CPUsmicrocontrollers and other CPUs
![Page 16: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/16.jpg)
Bare 8 bit CPUsBare 8 bit CPUsMany many many options.... Pros:
Dirt cheap ($2-6)Scales wellSmall form factor
Cons:
Need some EE knowledge toset up.Usually need additional partsfor minimum productOften need specialprogramming tools/software
![Page 17: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/17.jpg)
MicrocontrollerMicrocontrollerBoardsBoards Pros:
A lot of documentationEasy to get startedPlenty of 3rd party add-ons
Cons:
More costly ($15-25)Still somewhat limiting incertain applications
![Page 18: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/18.jpg)
Computer on aComputer on aboardboardPros:
PowerfulSimilar to writing software mostpeople are used to Comprehensive inputs/outputs
Cons:
Much more expensive ($40-$70)Has similar problems to acomputerLarger power requirementsUsually can't be "Programmed"
![Page 19: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/19.jpg)
Input/OutputInput/OutputHow to get your data in orHow to get your data in or
out of the real worldout of the real world
![Page 20: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/20.jpg)
Basic DigitalBasic DigitalThe most basic way toexchange information.
Nearly all CPUs haveaccessible input/output pinsand are able to use those pinsto output a 1 or 0. (or listenfor a 1 or 0)
![Page 21: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/21.jpg)
Basic AnalogBasic AnalogEasy way to interface a CPU with"The real world"
Many things don't just outputones and zeros. Solution: Use converters!Digital to analog converter (DAC)Analog to digital converter (ADC) Data is represented as a valuefrom a range.
![Page 22: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/22.jpg)
SerialSerialThe basis of a simple two wayconnection since 1962. (RS232)
Needs 2 wires to implementTransmit/Receive (Tx/Rx)Often a 3rd ground wire
One to one communicationIncluded on most devices
![Page 23: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/23.jpg)
SPISPILike serial, but more listeners!
Needs 3+n wires toimplement n listeners
Clock, Tx, Rx, and a selectfor each listener
One to many communicationAlso included on most devicesWith many listeners, theselect lines can becomeannoyingUsed in many commericaldevices today
![Page 24: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/24.jpg)
I²C I²C "I squared C""I squared C"
Flexible and featureful
Needs 2 wires to implementSDA & SCLOften a 3rd power wire
Many to many communicationPretty complicated, outsidethe scope of this presentation.
![Page 25: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/25.jpg)
InputInputLight sensor (Analog)Force/Pressure (Analog)Accelerometer (Serial)Gyroscope (Serial)Potentiometer (Analog)RFID (Serial)Distance (I2C)pH (I2C)Temperature (I2C)Motion (Serial)Geiger counter (Serial)Heart rate (Serial)Alcohol Sensor (I2C)Vibration Sensor (Analog)Camera (Video codec)GPS (Serial)
OutputOutputSpeakers (Analog)LEDs (Analog)
Many possibilitiesScreens (Parallel/Serial)Motors (Analog)Servos (Digital)Other devices!
![Page 26: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/26.jpg)
Embedded codingEmbedded codingissues/tricksissues/tricks
Some stuff you might run intoSome stuff you might run into
![Page 27: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/27.jpg)
Coding tricksCoding tricksSimple 8 and 16 bit CPU's aren't always themost featureful, and not every system has anice C compiler. (Thankfully most do)
What do you do if your chip only has an 8bit multiply?
Shift and AddWhat you only have 3 registers?
Have to put the return elsewhere
^ Real problems addressed in CMU's embedded courses
![Page 28: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/28.jpg)
Not the sameNot the sameold x86old x86
What is an "int"How many bits?
What exactly does one do with a triple de-refrence and add operator?
Thankfully, most widely used chips today useinstruction sets that have C or other languagecompilers.
![Page 29: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/29.jpg)
Robustness and SafetyRobustness and Safety
Would you trust the person sitting next to you todesign your car's breaking system?
What about the an airplane flight control system?
![Page 30: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/30.jpg)
Robustness and SafetyRobustness and SafetySome important concerns for safe embedded systems:
Floating point Imprecise, not safe to accumulate values in
Patriot Missile incidentRedundant systems!
There shouldn't be only one set ofwires between the pilot and the engines!
Watchdog and rebootingMars rover "freeze"Multiple reboot levelsIs it safe to reset?
Failsafe vs Faildeadly
![Page 31: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/31.jpg)
Robustness and SafetyRobustness and SafetyMost importantly:
"If safety is not baked into the recipe in theprocess of creating the product, it cannot be
added later."-Philip Koopman, Embedded Professor at CMU
![Page 32: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/32.jpg)
I want more?I want more?18-348/34918-348/349
More hardware/More software
![Page 33: Embedded Systems and Microcontrollers · 2015. 11. 4. · Embedded Systems and Microcontrollers. What is an embedded system? Definition An embedded system is a computer system with](https://reader035.fdocuments.us/reader035/viewer/2022081616/5fe608550de15164b50122b7/html5/thumbnails/33.jpg)
Thanks for coming!Thanks for coming!