Polling vs. Interrupts CS2852 9/18/2018

Slides:



Advertisements
Similar presentations
I/O Unit.
Advertisements

SE3910 Week 2, Class 2 Today Real-Time Systems Embedded Systems Other ??? Week 3 Tuesday Lab Lab start TBA SE-2811 Slide design: Dr. Mark L. Hornick Content:
Embedded Systems 7763B Mt Druitt College of TAFE
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
MICROPROCESSOR INPUT/OUTPUT
SE3910 Week 2, Class 1 Today Basic Circuits Other ??? Tomorrow Lab 2, S365 (Complete prelab BEFORE) Thursday See ScheduleSchedule SE-2811 Slide design:
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
Virtual Plant Tour Stamping – c&p=n#/27;109http:// c&p=n#/27;109 –
Today Networking in Linux/C Lab Eclipse cross-compiling Measuring latency of 100% CPU busy-wait polling Sleeping busy-wait polling Interrupt-driven response.
CS-280 Dr. Mark L. Hornick 1 CE-2800 Embedded Systems Software Dr. Mark L. Hornick web: myweb.msoe.edu/hornick Office: L-341 Phone:
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
SE-3910 Real-time Systems Week 5, Class 1 – Quick-Quiz (Ungraded) – Lab 4 turn-in up - due Tuesday, Week 5 – Select when to use Polling or Interrupts –
SE-3910 Real-time Systems Week 5, Class 2 – Lab turn-in page is up! – Use interrupts in a Linux/C environment – Scheduling – Watchdog follow-up Watchdog.
SE-3910 Real-time Systems Week 1, Class 2 – Fine Print – Web page available – Review Quiz 0 – What is a Real-Time Embedded System? Embedded & Real-Time.
Today Signals Nyquist Theorem (revisited) Audio Sampling Latency and Bandwidth Scheduling Theory SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr.
Week 7, Class 1: The Command Pattern (cont.) Get Ready for Poll Everywhere Labs 2 & 3 returned Lab 7 due this evening at 11pm Quiz tomorrow at start of.
SE3910 Week 8, Class 2 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 7, Class 2 (Wednesday) Half-Exam 2 Done.
SE3910 Week 8, Class 3 Week 4 Lab: Please return your graded Lab 4 to me so I can enter it in my gradebook Week 9 Lab: Individual demos of working sub-modules.
Real-time Software Design
REAL-TIME OPERATING SYSTEMS
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
SE-3910 Real-time Systems Week 10, Class 3 Loop jamming
Microprocessor Systems Design I
Lesson Objectives Aims Key Words Interrupt, Buffer, Priority, Stack
UNIT – Microcontroller.
Computer Architecture
Technology Literacy Hardware.
Interrupts In 8085 and 8086.
Polling vs. Interrupts CS2852 7/20/2018
Introduction of microprocessor
BVM Engineering College Electrical Engineering Department : Microprocessor and Microcontroller Interfacing Interrupts of 8051 Prepared by:
Chapter 3 Top Level View of Computer Function and Interconnection
8085 Microprocessor Architecture
CS703 - Advanced Operating Systems
Chapter 8 I/O.
Real-time Software Design
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Slide design: Dr. Mark L. Hornick
Week 7, Class 1: The Command Pattern (cont.)
Operating Systems Chapter 5: Input/Output Management
8085 Microprocessor Architecture
Introducing the PIC Mid-Range Family and the 16F84A
CSCI1600: Embedded and Real Time Software
Chapter 8 I/O.
X1 & X2 These are also called Crystal Input Pins.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
EE 472 – Embedded Systems Dr. Shwetak Patel.
Slide design: Dr. Mark L. Hornick
CSCI1600: Embedded and Real Time Software
Chapter 8 I/O.
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
Polling vs. Interrupts CS2852 4/9/2019
8085 Microprocessor Architecture
Polling vs. Interrupts CS2852 4/21/2019
Slide design: Dr. Mark L. Hornick
Slide design: Dr. Mark L. Hornick
11. MVC SE2811 Software Component Design
Slide design: Dr. Mark L. Hornick
Week 8, Class 3: Model-View-Controller
11. MVC SE2811 Software Component Design
SE-3910 Real-time Systems Week 4, Class 1 Quick-Quiz (Ungraded!)
Slide design: Dr. Mark L. Hornick
COMP3221: Microprocessors and Embedded Systems
Slide design: Dr. Mark L. Hornick
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Polling vs. Interrupts CS2852 9/18/2018 Interrupts: “Cut it out! I’ll tell you when we’re there!” SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Yoder

Slide design: Dr. Mark L. Hornick SE3910 9/18/2018 SE3910 Week 2, Class 1 Today Real-Time Systems Week 3 Lab Quiz 2 More circuits? Real-time systems Latency …? Lab 3 – Measuring Latency Complete prelab before lab – GB downloads, etc. 17q3: 1-4,8-15 Full agenda: Return Exam Questions about lab due tomorrow in class? Threads: Locking on null object Threads: invokeLater Threads: The squares example Decorator Class Diagram More on Java IO Class diagrams Design Principles in the patterns we’ve seen so far Compare with alternatives Decorator vs. array approach suggested in class Non-decorator array – decorator can be added on without modifying the original hierarchy Decorator has “before-after” and possibly other combinatorial control that would be hard-coded in array [Show “screenshot” of discussion from class? Or just re-type?] Strategy vs. Decorator class diagrams side-by-side Structural difference (inheritance optional in Strategy pattern?) Decorator vs. “Strategy” array Perhaps next: Coding Starbuzz coffee (?) Add real patterns ArrayList – null-checking Java I/O: Students do coding examples http://stackoverflow.com/questions/9358821/should-i-extend-arraylist-to-add-attributes-that-isnt-null SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder Dr. Josiah Yoder

What would you most like to do? SE3910 9/18/2018 What would you most like to do? Please take this survey: (You only need to pick 5) http://pollmill.com/f/what-would-you-most-like-to-do-m6e93hx.fullpage – OR – http://bit.ly/1F9RxRo And then…. http://pollmill.com/private/forms/what-would-you-most-like-to-do-m6e93hx/answers SE-2811 Dr.Yoder Dr. Josiah Yoder

Real-time and Embedded CS2852 9/18/2018 Real-time and Embedded Real-Time responding as rapidly as required by the user or the process being controlled. - Random House Dictionary (Abbrev.) Embedded System A combination of hardware & software to perform a specific function -Dr. Schilling’s slides Often real-time Real-Time System Examples: Temperature control of a chemical reactor Space mission control system Nuclear power generator system Many safety-critical systems Click-drag in a GUI Hospital reports delivered within minutes Examples of Systems Containing Embedded Systems Appliances: microwaves, VCRs, dishwashers, refrigerators, furnaces, clocks Medical devices: hearing aids, pacemakers, … Car systems: antilock brakes, engine timing and monitoring, seat/mirror positioner, air handling, lighting/environment Mobile phones, PDA’s, Music players, remote controls Diagram one of these devices, label the Real-time system and the Embedded Real-time system SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick Dr. Yoder

Slide style: Dr. Hornick Slide copied from Dr. Schilling’s Slides SE3910 9/18/2018 SE-1021 Dr. Josiah Yoder Slide style: Dr. Hornick Slide copied from Dr. Schilling’s Slides Dr. Josiah Yoder

What is a system? System A mapping from a set of inputs to outputs 9/18/2018 What is a system? System A mapping from a set of inputs to outputs SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Josiah Yoder

Example: Weather Monitor CS2852 9/18/2018 Example: Weather Monitor See summary Slide 1 Aka FBDs – Functional Block Diagrams FIGURES 1-3 Draw on board: LED sub-system Inputs: Wind direction (as 5v power supply to each LED) Outputs: Light in a pattern indicating the wind direction ADC Analog-to-Digital Converter Wind direction from weather vane as voltage read (0- 5v) off of a potentiometer (more on this) Wind direction from weather vane as serial 5 volt stream. (Figure) NOT as USB serial stream EXAMPLE Microprocessor Scheduler Module Input: Tasks to be scheduled (Data written to memory locations in the processor, Interrupts) Output: Sequenced scheduled tasks SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Yoder

Response Time & Latency 9/18/2018 Response Time & Latency Response Time The time between input events and all possible output events Release Time When a process is ready to start SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Josiah Yoder

Response Time & Latency 9/18/2018 Response Time & Latency Latency - a time delay between stimulus and response, or between cause and effect (Wiki) Memory Latency – Delay between write & read (Wiki) Interrupt Latency – Delay between stimulus and starting handler Audio Latency – Delay from audio in to audio out of a system (=response time) Network Latency – Delay from send to receive [or …] Conclusion: Latency = response time, possibly for a sub-system SE-2811 Dr.Yoder Dr. Josiah Yoder

Real-Time System Terminology CS2852 9/18/2018 Real-Time System Terminology Soft No system failure on failure to meet response time requirement (deadline) Firm System failure on failure to meet multiple deadlines Hard System failure on failure to meet a single deadline This is a real-time systems definition SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Yoder

SE3910 Exercise 9/18/2018 On your own: Write which kind of real-time system is being used With your partner, discuss & fill in the explanations System Classification Explanation Video Surveillance System for Car Dealership Laser welding robot to construct car frames 2 player air hockey game on game console Dr. Josiah Yoder

Five Misconceptions (paraphrased from Laplante and Ovaske) CS2852 9/18/2018 Five Misconceptions (paraphrased from Laplante and Ovaske) Real-time systems are fast All you need is a real-time OS a rate-monotonic scheduler lots of scheduling theory We’ve figured out how to make real-time systems Draw graph illustrating Rate-monotonic See hand notes SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Yoder

Microcontroller vs. Microprocessor SE3910 9/18/2018 Microcontroller vs. Microprocessor Microprocessor a single chip holding a single (large) CPU what most PC’s have Microcontroller A single chip holding a CPU, memory, peripherals What’s on the Beaglebone Black SE-2811 Dr.Yoder Dr. Josiah Yoder

System on a Chip vs. MicroController SE3910 9/18/2018 System on a Chip vs. MicroController Microntroller – see previous System on a Chip broader will include microcontroller may include more, for example analog components CE1901/CE1911 students use a SoC consisting of a microprocessor and an FPGA a bit of a buzzword – every manufacturer has their own meaning SE-2811 Dr.Yoder Dr. Josiah Yoder

The AM 335x (The Beaglebone’s CPU chip) SE3910 9/18/2018 The AM 335x (The Beaglebone’s CPU chip) http://www.ti.com/lit/ds/symlink/am3358.pdf http://www.ti.com/lit/ds/symlink/am3358.pdf SE-2811 Dr.Yoder Dr. Josiah Yoder

An i5 (Intel chip in laptop) SE3910 9/18/2018 An i5 (Intel chip in laptop) http://aphnetworks.com/reviews/intel_core_i5_750/2 What’s the difference? i5 really NEEDS external memory to work, the AM335x’s could, in theory operate without external memory (And my first attempts to find something like the above found the “chipset” instead.) This page: http://www.bjorn3d.com/2010/01/intel-i5-661-3-33ghz-dual-core-cpu/ says that the i7 chip includes graphics (i.e. GPU). Wow! SE-2811 Dr.Yoder Dr. Josiah Yoder

Timing Terminology Event Synchronous Asynchronous CS2852 9/18/2018 Timing Terminology Event A jump in the program counter Synchronous Predictable. Scheduled. In sync with other events Asynchronous Unpredictable. Unscheduled. External requests Aperiodic – No fixed period, asynchronous Sporadic – Extremely infrequent and aperiodic Punctual – Neither early nor late Draw pictures of time sequence for synchronous and asynchronous events. Do Comparison table SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Yoder

What is an event? for example, in SE 1021 SE3910 9/18/2018 Dr.Yoder Dr. Josiah Yoder

I/O hardware External pin Inside the device SE3910 9/18/2018 I/O hardware External pin Inside the device Custom text, p. 57 Laplante and Ovaske 4E, p. 52 Polling hardware is easy Interrupts require some additional hardware PIU – peripheral Interface Unit Laplante and Ovaske 4E, p. 52 SE-2811 Dr.Yoder Dr. Josiah Yoder

Interrupt Definitions CS2852 9/18/2018 Interrupt Definitions Interrupt An event in hardware that triggers the processor to jump from its current program counter to a specific point in the code. Interrupt Service Routine (ISR) The function that is called or the particular assembly code that is executed when the interrupt happens is called the Interrupt Service Routine (ISR). Interrupt flag (IFG) this is the bit that is set that triggers the interrupt, leaving the interrupt resets this flag to the normal state. Interrupt Enable Control bit that tells the processor that a particular interrupt should or should not be ignored. Interrupt Vector Table A table in memory which maps ISRs to interrupts. Dr. Yoder

SE3910 9/18/2018 ISR Handling (1) [Discussed at high level – Interrupt like any other event, only triggered by hardware] SE-3910 - Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling Dr. Josiah Yoder

ISR Handling (2) Fig 2.14 p. 54 Laplante and Ovaske 4E CS2852 9/18/2018 ISR Handling (2) Fig 2.14 p. 54 Laplante and Ovaske 4E PIU – Peripheral interface unit Acknowledgement not described in text, that I can see Important point: Interrupt Vector is sent to CPU telling it which interrupt occurred. Fig 2.14 p. 54 Laplante and Ovaske 4E PIU – Peripheral interface unit Dr. Yoder