Nurudeen Olayiwola Thomas Gutierrez

Slides:



Advertisements
Similar presentations
Chapter 3 Basic Input/Output
Advertisements

Microprocessors.
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
A look at interrupts What are interrupts and why are they needed.
8085 Interrupts LAKSHMI.B.E.1. Interrupts  Interrupt is a process where an external device can get the attention of the microprocessor. ◦ The process.
Interrupts Disclaimer: All diagrams and figures in this presentation are scanned from the book “Microprocessors and Programmed Logic” authored by Kenneth.
CSCI 4717/5717 Computer Architecture
68HC11 Polling and Interrupts
EET 2261 Unit 9 Interrupts  Read Almy, Chapters 17 – 19.  Homework #9 and Lab #9 due next week.  Quiz next week.
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
A look at interrupts What are interrupts and why are they needed.
1 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
1 Reset and Interrupts Advanced Programming. 2 Resets and Interrupts See the Reset and Interrupts Section in the 68HC11E Family Technical Data Sheet (pp.79-96)
INTERRUPTS PROGRAMMING
ECE 265 – LECTURE 12 The Hardware Interface 8/22/ ECE265.
From: Er Sanjeev Goyal Sr Lect ECE GPC,Bathinda 117/04/2013Punjab Edusat society.
Interrupts. 2 Definition: An electrical signal sent to the CPU (at any time) to alert it to the occurrence of some event that needs its attention Purpose:
Introduction to Embedded Systems
COMP201 Computer Systems Exceptions and Interrupts.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
UNIT 8 Keypad Interface Contact Closure Counter Exceptions (Interrupts and Reset)
Interrupts Signal that causes the CPU to alter its normal flow on instruction execution ◦ frees CPU from waiting for events ◦ provides control for external.
Chapter 6: Interrupts and Resets
Revised: Aug 1, ECE 263 Embedded System Design Lessons 23, 24 - Exceptions - Resets and Interrupts.
MICROPROCESSOR INPUT/OUTPUT
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
Interrupts and reset operations. Overview  Introduction to interrupts – What are they – How are they used  68HC11 interrupt mechanisms – Types of interrupts.
Microprocessors 1 MCS-51 Interrupts.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
1 Interrupts, Resets Today: First Hour: Interrupts –Section 5.2 of Huang’s Textbook –In-class Activity #1 Second Hour: More Interrupts Section 5.2 of Huang’s.
AT91 Interrupt Handling. 2 Stops the execution of main software Redirects the program flow, based on an event, to execute a different software subroutine.
System Integration Module MTT Motoola SYSTEM INTEGRATION MODULE (SIM)
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
MICRO-CONTROLLER MOTOROLA HCS12 Interrupts Mechatronics Department Faculty of Engineering Ain Shams University.
Resets & Interrupts MTT CPU08 Core Motorola CPU08 RESETS & INTERRUPTS.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Structure and Role of a Processor
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
CS-280 Dr. Mark L. Hornick 1 Sequential Execution Normally, CPU sequentially executes instructions in a program Subroutine calls are synchronous to the.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
ECE 3430 – Intro to Microcomputer Systems
8085 Interrupts LAKSHMI.B.E..
68HC11 Interrupts & Resets.
Mon. Oct 2 Announcements Quiz Postponed to Wednesday – still only on 2.a + 2.b Video lecture for 2.a posted Lab 6 experiment extension You must come to.
The process starts from the I/O device
Timer and Interrupts.
Computer Architecture
Interrupts In 8085 and 8086.
Unit - 1 Interrupts M.Brindha AP/EIE
8085 Interrupts.
Interrupt.
Interrupts Interrupt is a process where an external device can get the attention of the microprocessor. The process starts from the I/O device The process.
COMPUTER PERIPHERALS AND INTERFACES
Interrupts.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Interrupts 1/18/2019.
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
COMP3221: Microprocessors and Embedded Systems
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Presentation transcript:

Nurudeen Olayiwola Thomas Gutierrez General Info Purpose/ Applications Interrupts Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Nurudeen Olayiwola Thomas Gutierrez Non-maskable interrupts Example Conclusion

Question?? General Info Purpose/ Applications When you are at home sitting on your lazy boy, how do you know when someone wants to talk to you on the phone? Do you periodically get up and pick up the phone to see if someone is there? Or do you wait till the phone rings to answer it? Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Answer? General Info Purpose/ Applications The first scenario shows a person doing what is known as polling. The second case illustrates an interrupt-driven person. Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Polling AKA “busy waiting”; looping program General Info Purpose/ Applications AKA “busy waiting”; looping program Continues checking status register until a particular state exists “Are we there yet? Are we there yet? Are we there yet?” What happens if something occurs at other devices while the processor is busy waiting?? Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Interrupt Device sends a special signal to CPU when data arrives. General Info Purpose/ Applications Device sends a special signal to CPU when data arrives. “Wake me up when we get there.” Responds to hardware interrupt signal by interrupting current processing. Now CPU can perform tasks before and after interrupt instead of just polling!! Good! Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

General Interrupt Flow General Info Purpose/ Applications Completes current instruction Saves current state to status registers Identify source Jump to and activate Interrupt Service Routing (ISR) Return to original program (RTI) and restore state Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Register CPU Interrupt driven Example I/O device I/O device

Interrupts: Flow Chart General Info SOFTWARE INTERRUPT STACK MPU REGISTER CONTENTS SET APPROPRIATE BIT IN CCR LOAD INTERRUPT VECTOR INTO PROGRAM COUNTER VECTOR TABLE HARDWARE MASK SET? N Y EXECUTE INTERRUPT SERVICE ROUTINE $FFC0 $FFFF CONTINUE MAIN PROGRAM

Brief Background General Info Purpose/ Applications Univac 1103/1103A (1953-56) – first recognized CPU with interrupts. Current instruction was stored in memory and program counter loaded with a fixed address. Other notables: IBM (1954) – first to use interrupt masking NBS DYSEAC (1954) – first with I/O interrupts Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Purpose/Applications General Info Purpose/ Applications To modify or do additional instructions based on internal requests and/or external devices. Provide a means for suspending current instructions for more important tasks. Hardware (called Interrupts or Resets) Reset User-defined interrupt Timer operations CPU operations monitor failure Software Illegal instruction SWI Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Purpose/Applications (cont.) General Info Purpose/ Applications Coordinating I/O operations Notifies the CPU that an input is ready or an output can be changed Timing Periodic (clock-driven) interrupts remind the CPU of the passage of time Multi-tasking Updating counters Timing during interactive programs Errors Interrupts can notify of error situations Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Purpose/Applications (cont.) General Info Purpose/ Applications Practical uses/examples Change direction of a motor. Auto wiper speed increased or decreased. Pressing a pause button on a VCR HC11 controlled transmission system Etc. Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Types of interrupts Ignorable interrupts (or Maskable) General Info Purpose/ Applications Ignorable interrupts (or Maskable) Most often used Good for using when computer needs to do something more important When the interrupt mask is set, interrupts are hidden and therefore are ignored. Non-ignorable interrupts (Non-maskable) NMI’s take precedence and interrupt any task Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Interrupt Vector Table General Info Purpose/ Applications When an interrupt occurs, control of the program moves to the interrupt handling routine Event similar to subroutine How do we know where the handler routine is though?? The address of the handler is provided by the interrupt vector table IVT has one entry for each type of interrupt Each entry is indexed by interrupt type, and includes a pointer to the handler Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Interrupt Vector Table Maskable when the I-bit of CCR is set Interrupt Vector Table General Info Purpose/ Applications lowest priority Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example highest priority Unmaskable

Maskable/Unmaskable 6 Non-Maskable General Info Purpose/ Applications 6 Non-Maskable always interrupt the program execution 15 Maskable can enable or disable by mask bits HOW? Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Stacking order General Info Purpose/ Applications When an interrupt occurs: Purpose/ Applications SP-9 1. Finish execution of the current instruction Note: Non-maskable interrupts and resets happen immediately SP-8 CCR Interrupt Priority/ IVT SP-7 ACCB SP-6 ACCA 2. HC11 pushes on stack: PC, accumulators and registers, CCR SP-5 IXH Controlling Interrupts SP-4 IXL SP-3 IYH 3. HC11 sets the I-bit Masks interrupts - can’t interrupt an interrupt Maskable interrupts SP-2 IYL SP-1 PCH 4. Looks up vector of highest-priority interrupt SP-0 PCL 5. Branches to interrupt service routine Executes until RTI is encountered Example 6. Restores accumulators and registers, CCR from stack (note: this includes restoring the I-bit of CCR) 7. Returns to instruction after the one that was interrupted (note: other interrupts may be pending now)

Controlling Interrupts: The I-bit General Info Purpose/ Applications Exists as bit 4 in the Condition Code Register (CCR) When set (I=1), interrupts will be inhibited and placed as pending When cleared (I=0), interrupt servicing will be allowed when asked The I bit is always set while servicing an interrupt; Interrupts can’t nest Set during RESET to allow minimum system initialization Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Controlling Interrupts: The I-bit General Info Purpose/ Applications Can also be set by software to prevent execution of maskable interrupts SEI (SEt Interrupt Mask) Can be cleared by software instructions CLI (CLear Interrupt Mask) Automatically cleared by RTI instruction Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Maskable Interrupt: HPRIO General Info Purpose/ Applications Can elevate the priority of one of the maskable interrupts. Uses bits 0-3 of HPRIO (Highest PRIOrity Interrupt Register) Default is IRQ. Can be set at anytime during program as long as I bit is set. Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Maskable Interrupt: IRQ General Info Purpose/ Applications Highest priority maskable interrupt IRQ pin provides additional external interrupting source Other additional MCU pins can be used as interrupt inputs: Example: XIRQ input Main-Timer Capture Pins Pulse Accumulator Pin IRQE Bit in the OPTION control used to specify IRQ pin configuration IRQE = 0 -> Low level sensitive IRQE = 1 -> Low-going edge sensitive (single source only) Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Example

Maskable Interrupt: IRQ General Info Purpose/ Applications Controlled by a pin on the HC11 A low signal will initiate interrupt sequence Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts 1 Example

Non-maskable Interrupt: XIRQ General Info Purpose/ Applications Enabled by TAP instruction by clearing X-bit upon system initialization After being cleared, software cannot set the X-bit, thus XIRQ is non-maskable. Higher priority than any source maskable by the I-bit. Both the X and I bits are automatically set by hardware after stacking the CCR. RTI restores X and I bit to pre-interrupt states Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Non-maskable interrupts Example

Non-maskable Interrupt: SWI General Info Purpose/ Applications Software instruction, thus cannot be interrupted until completed Uninhibited by global mask bits in the CCR Similar to other interrupts, sets the I-bit upon servicing Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts Non-maskable interrupts Example

Example - IRQ handler General Info Purpose/ Applications >>Whenever button is pushed, update a counter and print out the current count Purpose/ Applications 1. Write the IRQ handler routine IRQHANDLE ORG $3000 ldaa count ; A <-- current count inca ; increment count staa count ; write back count ldx #msg ; print out msg jsr OUTSTRG ldx #count ; print out count jsr OUT1BYT rti ; all done – return org $2000 ; data section msg fcc “Number of times button pressed:” fcb $04 count fcb 0 ; button counter org $00ee JMP IRQHANDLE org $2200 ; main program cli ; enable interrupts loop bra loop ; endless loop Interrupt Priority/ IVT Controlling Interrupts Maskable interrupts 2. Write the initialization and main routine IRQ vector at $FFF2 Example 3. Do-nothing program!

The SIX untouchables: NONMASKABLE RESET CLOCK MONITOR COP Watchdog Illegal Opcode XIRQ SWI Conclusion Conclusion

Advantages and Disadvantages Efficient, better than polling Multitasking Disadvantage They can occur randomly Requires additional hardware, sometimes Conclusion Conclusion

Questions?? General Info Purpose/ Applications Interrupt Priority/ IVT Controlling Interrupts Questions?? Maskable interrupts Example Conclusion

References http://courses.cs.tamu.edu/cpsc462/ walker/Slides/Exceptions_Interrupts_1.ppt http://oa-003.spu.edu/bolding/ee3280/nosound/16-Exceptions.ppt Previous semester presentations…