CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.
-
Upload
keith-matthys -
Category
Documents
-
view
216 -
download
1
Transcript of CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.
![Page 1: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/1.jpg)
CYBERPHYSICAL SYSTEMS&EMBEDDED PROCESSORS
EEN 417Fall 2013
8/27/13, Dr. Eric Rozier, V1.0, ECE
![Page 2: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/2.jpg)
CYBERPHYSICAL SYSTEMS
![Page 3: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/3.jpg)
Model-Based Design
![Page 4: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/4.jpg)
Cyber Physical Systems:Computational +
Physical
CPS is Multidisciplinary
Computer Science:
Carefully abstracts the physical world
System Theory:
Deals directly with physical quantities
![Page 5: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/5.jpg)
Challenge
![Page 6: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/6.jpg)
What this course is about
• A principled and scientific approach to engineering embedded systems– Modeling, Design, Implementation, Testing,
Analysis– Not just hacking!
![Page 7: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/7.jpg)
Traditionally, embedded systems has been an industrial (not academic) problem, about resource limitations.
small memory small data word sizes relatively slow clocks
•When these are the key problems, emphasize efficiency: write software at a low level (in assembly code or C) avoid operating systems with a rich suite of services develop specialized computer architectures:
– programmable DSPs– network processors
develop specialized networks– Can, FlexRay, TTP/C, MOST, etc.
•This is how embedded SW has been designed for 30 years
![Page 8: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/8.jpg)
But embedded systems do have more fundamental differences from general-purpose computation:
•time matters– “as fast as possible” is not good enough
•concurrency is intrinsic– it’s not an illusion (as in time sharing), and– it’s not (necessarily) about exploiting parallelism
•processor requirements can be specialized– predictable, repeatable timing– support for common operations (e.g. FIR filters)– need for specialized data types (fixed point, bit vectors)
•programs need to run (essentially) forever– memory usage has to be bounded (no leaks!!)– rebooting is not acceptable
![Page 9: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/9.jpg)
What about “real time”?
Make it faster!What if you need “absolutely positively on time”?
Today, most embedded software engineers write code, build your system, and test for timing. Model-based design seeks to specify dynamic behavior (including timing) and “compile” implementations that meet the behavior.
![Page 10: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/10.jpg)
Prioritize and Pray!
Real-Time Multitasking?
All too often, real-time operating systems (RTOSs) are used in a rather ad hoc way. Without any particular principles, engineers tweak priorities until the prototype works under test.
The resulting system is brittle, meaning the small changes in the operating conditions (or in the design of the system) can cause big changes in behavior. For example, replacing the processor with a faster one can cause real-time failures.
![Page 11: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/11.jpg)
An engineer’s responsibility
Korean Air 747 in Guam, 200 deaths (1997) 30,000 deaths and 600,000 injuries from medical devices (1985-2005)
– perhaps 8% due to software?
•source: D. Jackson, M. Thomas, L. I. Millett, and the Committee on Certifiably Dependable Software Systems, "Software for Dependable Systems: Sufficient Evidence?," National Academies Press, May 9 2007.
![Page 12: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/12.jpg)
A Story
•A “fly by wire” aircraft, expected to be made for 50 years, requires a 50-year stockpile of the hardware components that execute the software.
•All must be made from the same mask set on the same production line. Even a slight change or “improvement” might affect timing and require the software to be re-certified.
![Page 13: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/13.jpg)
Abstraction Layers•The purpose for an abstraction is to hide details of the implementation below and provide a platform for design from above.
![Page 14: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/14.jpg)
Abstraction Layers•Every abstraction layer has failed for time-sensitive applications.
![Page 15: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/15.jpg)
Is the problem intrinsic in the technology?
•Electronics technology delivers highly repeatable and precise timing…•… and the overlaying software abstractions discard it.
20.000 MHz (± 100 ppm)
![Page 16: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/16.jpg)
EMBEDDED PROCESSORS
![Page 17: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/17.jpg)
Typical PC Architecture• Single processor
• (plus GPU)• Not a lot of concurrency
• Market is dominated by a single architecture and instruction set
• x86
Image courtesy of Wikimedia Commons GPL
![Page 18: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/18.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
Images courtesy of iFixit © 2012, CC-BY-NC-SA
![Page 19: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/19.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Images courtesy of iFixit © 2012, CC-BY-NC-SA
![Page 20: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/20.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Barely begun to examine this system!
![Page 21: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/21.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Barely begun to examine this system!
Four different embedded processors!
![Page 22: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/22.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Barely begun to examine this system!
Four different embedded processors!
Four different manufacturers!
![Page 23: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/23.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Barely begun to examine this system!
Four different embedded processors!
Four different manufacturers!
Four different architectures!
![Page 24: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/24.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Lots of concurrency!
![Page 25: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/25.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Lots of concurrency!
Different instruction sets!
![Page 26: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/26.jpg)
Example Embedded System: Apple iPhone• A5 Processor• Qualcomm DSP
…
• Texas Instruments touchscreen microcontroller
• Cirrus Logic DSP
Highly Specialized!
![Page 27: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/27.jpg)
What advantages might there be to specialization?
![Page 28: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/28.jpg)
What advantages might there be to specialization?
Energy consumption, specialized hardware, efficiency, etc
![Page 29: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/29.jpg)
ATMEGA328,
AVR PROCESSORS,
& ARDUINO
![Page 30: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/30.jpg)
Dueling Architectures
![Page 31: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/31.jpg)
Dueling Architectures
![Page 32: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/32.jpg)
Advantages/Disadvantagesto each?
![Page 33: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/33.jpg)
Complexity, dedicated buses
Von Neumann bottleneck
Advantages/Disadvantagesto each?
![Page 34: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/34.jpg)
ATmega328
![Page 35: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/35.jpg)
ATmega328• CPU
• (Details later)
![Page 36: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/36.jpg)
ATmega328• Flash – program
memory• 32K
• SRAM – data memory• 2K
• EEPROM• 1K• Nonvolatile memory
![Page 37: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/37.jpg)
What kind of architecture?
![Page 38: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/38.jpg)
What kind of architecture?
![Page 39: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/39.jpg)
AVR CPU
![Page 40: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/40.jpg)
AVR CPU
Instruction fetch and decode
![Page 41: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/41.jpg)
AVR CPU
ALU instructions
![Page 42: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/42.jpg)
AVR CPU
I/O and special functions
![Page 43: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/43.jpg)
AVR CPU32 8-bit general purpose registersPart of SRAM memory space
![Page 44: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/44.jpg)
AVR CPUX, Y, and Z registers16-bit registers made using registers 26-31Support indirect addressing
![Page 45: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/45.jpg)
AVR Memory
FLASH
BOOT SECTION
32 registers
64 I/O registers
160 Ext I/O Registers
Internal SRAM
EEPROM
![Page 46: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/46.jpg)
AVR Architecture• Three timers• Flexible
• Choose clock rate• Choose “roll-over”• Generate interrupts• Generate PWM
signals
![Page 47: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/47.jpg)
AVR Architecture• Interface to pins• Each pin directly
programmable• Program direction (I/O)• Program value• Program pull-ups
• Some special pins• Analog/Digital• Clocks• Reset
![Page 48: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/48.jpg)
AVR Architecture• 3 8-bit ports (B, C, D)• Each port controlled by
3 8-bit registers• Each bit controls one I/O pin• DDRx – direction register
• Defines Input(0) or Output(1)
• PINx – Pin input value• Reading this “register” returns
value of the pin
• PORTx – Pin output value• Writing to this register sets
value of pin
![Page 49: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/49.jpg)
Pin Circuitry
![Page 50: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/50.jpg)
Pin Input
PINx
DDRx=0
PORTx
![Page 51: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/51.jpg)
Synchronization and Timing
Takes a clock cycle for data output to be reflected on the input
![Page 52: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/52.jpg)
Why is this necessary?
![Page 53: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/53.jpg)
Why is this necessary?What if the pin changes value near the falling edge of a clock cycle?
![Page 54: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/54.jpg)
Why is this necessary?What if the pin changes value near the falling edge of a clock cycle?
Metastability
![Page 55: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/55.jpg)
Pin Output
PINx
DDRx=1
PORTx
![Page 56: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/56.jpg)
Pin Input – PORT controls pullup
PINx
DDRx=0
PORTx
![Page 57: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/57.jpg)
Pullups
• Pullups– If a pin is an input (DDRxi = 0)
• PORTxi = 0 – Pin is floating• PORTxi = 1 – connects pullup to the pin
– Keeps pin from floating if noone is driving– Llows wired-OR bus
– Individual bits can be set cleared using bit-ops– A bit can be toggled by writing I to PINxi
![Page 58: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/58.jpg)
Arduino Uno
ATmega328
![Page 59: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/59.jpg)
Arduino Uno
ATmega328ATmega16U2
![Page 60: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/60.jpg)
Arduino Digital and Analog I/O Pins
• Digital pins– Pins 0-7: PORT D– Pins 8-13: PORT B– Pins 14-19: PORT C
• Named A0 – A5• Arduino analog
– Pins 0 and 1 are RX and TX for serial comms
– Pin 13 connected to base board LED
![Page 61: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/61.jpg)
More Info
• Too much to cover!
• See data sheets for Arduino and ATmega328– http
://www.atmel.com/Images/8271s.pdf
– http://www.atmel.com/images/doc0856.pdf
– http://arduino.cc/en/Main/ArduinoBoardUno
![Page 62: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/62.jpg)
PARALLELISM
![Page 63: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/63.jpg)
Parallelism vs. Concurrency
• What’s the difference?
![Page 64: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/64.jpg)
Parallelism vs. Concurrency
• Concurrency is central to embedded systems!
– Concurrency – different parts of the program conceptually execute simultaneously
– Parallel – different parts physically execute simultaneously
![Page 65: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/65.jpg)
Pipelining
![Page 66: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/66.jpg)
Sample five stage pipeline
What’s going on here?
![Page 67: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/67.jpg)
Reservation Table
![Page 68: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/68.jpg)
Pipeline hazards represented by dashed lines
Pipeline Hazards!
![Page 69: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/69.jpg)
Pipeline Interlock to prevent hazard
![Page 70: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/70.jpg)
Other types of parallelism
• CISC vs. RISC• Superscalar processors• Hyperthreading• Multicore
![Page 71: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/71.jpg)
WRAP UP
![Page 72: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/72.jpg)
Industrial Connection
• Mr. Tony Kaap– Motion Picture Industry: Motion Capture
• Mr. Robert Zeh– Financial Industry: Real-time systems
• Stanford University– Tagging of Pelagic Predators
• MBARI– Deep sea embedded systems
and data collection• Dr. Kristin Rozier
– NASA: Safety Critical Systems
![Page 73: CYBERPHYSICAL SYSTEMS & EMBEDDED PROCESSORS EEN 417 Fall 2013 8/27/13, Dr. Eric Rozier, V1.0, ECE.](https://reader037.fdocuments.net/reader037/viewer/2022110319/56649c7c5503460f94930470/html5/thumbnails/73.jpg)
For next time
• Read Chapter 2 (Continuous Dynamics)
• Assignment 1: Problems 1, 2, and 3 of Chapter 7.