Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.

Slides:



Advertisements
Similar presentations
Computer Architecture
Advertisements

Chapter 3 Basic Input/Output
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
Chapter 12: Interrupts. Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. The Intel Microprocessors:
University of Tehran 1 Microprocessor System Design Interrupt Omid Fatemi
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.
I/O Unit.
Processor System Architecture
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
CSCI 4717/5717 Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
6-1 I/O Methods I/O – Transfer of data between memory of the system and the I/O device Most devices operate asynchronously from the CPU Most methods involve.
Interrupt Processing Haibo Wang ECE Department
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: internal fault (e.g.. divide by.
Midterm Tuesday October 23 Covers Chapters 3 through 6 - Buses, Clocks, Timing, Edge Triggering, Level Triggering - Cache Memory Systems - Internal Memory.
Introduction to Interrupts
Chapter 11 Interrupt Interface of the 8088 and 8086 Microcomputer
Interrupts – (Chapter 12)
GURSHARAN SINGH TATLA PIN DIAGRAM OF 8085 GURSHARAN SINGH TATLA
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
MICROPROCESSOR INPUT/OUTPUT
The Functions of Operating Systems Interrupts. Learning Objectives Explain how interrupts are used to obtain processor time. Explain how processing of.
Interrupt Interrupt – to break the flow of speech or action of (someone) by saying or doing something (Longman dictionary)
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
Lecture 09: Interrupts & The 80x86 IBM PC and Compatible Computers Chapter 14 Interrupts and the 8259 Chip.
Interrupt Interrupt – to break the flow of speech or action of (someone) by saying or doing something (Longman dictionary)
Interrupts Useful in dealing with: The interface: Random processes;
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
13-Nov-15 (1) CSC Computer Organization Lecture 7: Input/Output Organization.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
Chapter 3 Basic Input/Output. Chapter Outline Basic I/O capabilities of computers I/O device interfaces Memory-mapped I/O registers Program-controlled.
Dec Hex Bin 14 E ORG ; FOURTEEN Interrupts In x86 PC.
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
8086 Interrupts and Interrupt Applications
بسم الله الرحمن الرحيم MEMORY AND I/O.
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin gmail.com.
Interrupt-Driven I/O There are different types of interrupts –Hardware Generated by the 8259 PIC – signals the CPU to suspend execution of the current.
INTERRUPTS. Topics to be discussed  8088/86 Hardware Interrupts pins 8088/86 Hardware Interrupts pins   Pin description Pin description.
1 Interrupts A Course in Microprocessor Electrical Engineering Dept. University of Indonesia.
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from.
Interrupt Processing Sequence
Interrupts and interrupt responses
8085 Interrupts LAKSHMI.B.E..
MICROPROCESSOR BASED SYSTEM DESIGN
Microprocessor and Assembly Language
Microprocessor Systems Design I
The process starts from the I/O device
Introduction An interrupt is an event which informs the CPU that its service (action) is needed. Sources of interrupts: Internal fault (e.g.. divide by.
Computer Architecture
Interrupts In 8085 and 8086.
Interrupts – (Chapter 12)
Interrupt.
8259 Chip The Intel 8259 is a family of Programmable Interrupt Controllers (PIC) designed and developed for use with the Intel 8085 and Intel 8086 microprocessors.
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /20/2018.
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.
11.1 Interrupt Mechanism, Type, and Priority
X1 & X2 These are also called Crystal Input Pins.
8259 Programmable Interrupt Controller
Interrupts.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
CNET 315 Microprocessor & Assembly Language
Programmable Interrupt Controller (PIC)
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

Khaled A. Al-Utaibi

 Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the ISR Address  Hardware Interrupt Timing  Interrupt Acknowledge Cycles

 The 80x86 processors receive interrupts from three different sources: − (1) The processor itself, due to an internal fault (e.g. an attempt to divide by zero) − (2) The software interrupt instruction INT n (commonly used in the PC to access the BIOS and DOS functions), − (3) External hardware.  I/O devices that interface to the processor using a hardware interrupt are said to be interrupt driven.

 When interfacing I/O devices to a microprocessor, the real problem for the microprocessor is that it does not know when the I/O device is ready.  One way of determine if a device is ready is to program the processor to repeatedly poll (check) the I/O device BUSY/READY line (flag).  The disadvantage of this approach (hardware polling) is that all of the resources of the processor are wasted waiting for this flag (i.e. no other tasks can be performed).

 A more logical approach would be to have the I/O device tell the processor when it is ready.  This is the purpose of the microprocessor's interrupt input (hardware interrupt).  Using this technique, the processor can spend most of its time with other tasks, only servicing the I/O device briefly when interrupted.

 At the end of each instruction, the processor samples its interrupt input.  If active, control is transferred to a special Interrupt Service Routine (ISR).  Figure 1 shown the sequence of this process: − (1) The processor is assumed to be executing its main task. − (2) The I/O READY flag causes an interrupt to occur. − (3) The current instruction is finished. − (4) The CS, IP (or EIP), and flag registers are pushed onto the stack at time 4. − (5) The control transfers to the ISR. − (6) The ISR is executed, terminating with the instruction lRET (interrupt return). − (7) The CS, lP, and flag registers are recovered from the stack. − (8) The original task is resumed.

Figure: Sequence of hardware interrupt process.

 The 80x86 processors have just 2 hardware interrupt pins: − (1) INTR − (2) NMI.  NMI (Non-Maskable Interrupt) − It cannot be blocked; the processor must respond to it. − For this reason the NMI input is usually reserved for critical system functions, for example, saving the processor state when a power failure is eminent.  INTR (Interrupt) − It is maskable via the IF flag. − Using the instruction STI-set interrupt flag-interrupts are enabled on INTR. − Similarly, the instruction CLI-dear interrupt flag--disables interrupts on this input.

 Figure 2 shows the flowchart of the 80x86 processors response to internal and external interrupts.  The internal interrupts have the highest priority (they are serviced first when multiple interrupts are received).  The processor automatically clears IF when an interrupt (internal or external) is received.  This means an INTR interrupt cannot interrupt a previous service routine that has not yet completed (unless that routine specifically sets IF to allow this).

 When the IRET instruction is executed, the flags are restored, and if the IF (the interrupt flag) was previously set, INTR interrupts will again be enabled.  When the TF (the trap flag) is set, the processor will execute a type 1 interrupt after each program instruction.  Typically, this is used in debugging mode, as it allows the processor to be single-stepped one instruction at a time.  This interrupt has lowest priority (it is serviced last when multiple interrupts occur).

Figure 2: Flowchart of the 80x86 processors response to internal and external interrupts.

 In Real Mode (8086), the address of the interrupt service routine is stored in 4 consecutive memory locations (a double-word) in an interrupt vector table beginning at address 00000H.  When an interrupt occurs, an 8-bit type number is supplied to the processor, which identifies the appropriate entry in this table.  The method for determining the type number depends on the interrupt source: − (1) Software interrupts supply the type number as part of the instruction (INT n, where n is the type number). − (2) Internal interrupts have predefined type numbers: for example, a divide-by-zero error causes a type 0 interrupt (Refer to Table 1 for a complete list.) − (3) The NMI hardware interrupt is predefined as type 2 and extracts its vector from locations 00008H-0000BH. − (4) INTR must gate its type number onto data bus lines D0-D7 during a special interrupt acknowledge cycle.

 The address where the vector is to be stored is computed by the processor by multiplying the type number by four (or by eight in Protected Mode).  The resulting number is then used as a pointer to one of the 256 possible interrupt vectors.

Table 1: Predefined interrupt type numbers.

 Example 1: A particular Real Mode interrupt has a type number n = 41H. If the corresponding ISR begins at address 09E3:0010H, determine the locations in the vector table to store this address. − The vector address is calculated by multiplying 41H by four. − This is done most easily by rotating 41H left twice.  41H = ;  rotate left twice -> = 104H. − The offset address of the ISR is stored in the low word − location and the segment address in the high-word location.

 The 80x86 processors sample the INTR and NMI inputs at the end of each currently executing instruction.  The NMI input is rising-edge-triggered and internally synchronized.  The INTR input is level-triggered and must be held high until acknowledged by the processor.  The 8086 and 8088 provide the INTA signal for this purpose; the 386 and later processors provide a unique bus cycle that can be decoded for this purpose.  The NMI input (and all internal interrupts) are not acknowledged.

 Regardless of the processor, when the INTR interrupt is accepted, two interrupt acknowledge cycles are executed (two INTA’ pulses), separated by four idle clock pulses (to allow for 8259A programmable interrupt controller recovery time).  The first cycle acknowledges the interrupt request and alerts the external hardware to prepare to gate the type number onto the data bus lines.  During the second cycle, the processor inputs the contents of its D0-D7 data lines, which it interprets as one of the 256 possible type numbers.

 Figure shows a circuit that can be used to drive the INTR input of the  In this case the I/O device is assumed to supply a falling edge to indicate that it is ready for more data.  This signal clocks the flip-flop, driving INTR high.  The first INTA’ pulse resets Q, removing INTR before it can be interpreted as a second interrupt request.  The RESET’ input ensures that INTR will be low after the system is reset.

Figure 3: circuit that to drive the INTR input of the 8086

 Figure 4 illustrates a technique for gating the type number onto the low data bus lines.  The LOCK signal is combined with INTA’ to enable the tri-state gates during the  second INTA’ pulse, when the processor expects the type number.  In this example, the gates are wired to input n = 41H.

Figure 4: Gating the type number onto the low data bus lines