MICROPROCESSOR BASED SYSTEM DESIGN

Slides:



Advertisements
Similar presentations
Dr. Rabie A. Ramadan Al-Azhar University Lecture 3
Advertisements

Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
1/1/ / faculty of Electrical Engineering eindhoven university of technology Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir.
Chapter 12: Interrupts. Copyright ©2009 by Pearson Education, Inc. Upper Saddle River, New Jersey All rights reserved. The Intel Microprocessors:
Unit 4 Chapter-1 Multitasking. The Task State Segment.
3-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Intel 8088 (8086) Microprocessor.
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.
1 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
Introduction to Interrupts
Introduction to Computer Engineering by Richard E. Haskell Interrupts Module M17.3 Sections 11.3, 14.1.
Chapter 11 Interrupt Interface of the 8088 and 8086 Microcomputer
Interrupts – (Chapter 12)
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.
Micro-Computer Applications: Procedures & Interrupts Dr. Eng. Amr T. Abdel-Hamid ELECT 707 Fall 2011.
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
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
Interrupt Interrupt – to break the flow of speech or action of (someone) by saying or doing something (Longman dictionary)
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;
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
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.
Virtual 8086 Mode  The supports execution of one or more 8086, 8088, 80186, or programs in an protected-mode environment.  An 8086.
Dec Hex Bin 14 E ORG ; FOURTEEN Interrupts In x86 PC.
EFLAG Register of The The only new flag bit is the AC alignment check, used to indicate that the microprocessor has accessed a word at an odd.
8086 Interrupts and Interrupt Applications
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
بسم الله الرحمن الرحيم MEMORY AND I/O.
BIOS and DOS Interrupts Basic Input /Outpu System Disk Operating System.
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
1 Interrupts A Course in Microprocessor Electrical Engineering Dept. University of Indonesia.
Computer System Structures Interrupts
Architectures of Digital Information Systems Part 1: Interrupts and DMA dr.ir. A.C. Verschueren Eindhoven University of Technology Section of Digital.
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from.
COURSE OUTCOMES OF Microprocessor and programming
Interrupts and interrupt responses
8085 Interrupts LAKSHMI.B.E..
Microprocessor and Assembly Language
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
The process starts from the I/O device
Anton Burtsev February, 2017
Introduction to the processor and its pin configuration
Interrupts In 8085 and 8086.
Interrupts – (Chapter 12)
Computer Organization And Assembly Language
Introduction of microprocessor
Dr. Michael Nasief Lecture 2
Intel 8088 (8086) Microprocessor Structure
Microprocessor and Assembly Language
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
Arithmetic using a stack
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /20/2018.
Intel 8088 (8086) Microprocessor Structure
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.
Process Description and Control
COMPUTER PERIPHERALS AND INTERFACES
Architectural Support for OS
Interrupts.
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Md. Mojahidul Islam Lecturer Dept. of Computer Science & Engineering
Computer Architecture
CNET 315 Microprocessor & Assembly Language
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Architectural Support for OS
CS-401 Computer Architecture & Assembly Language Programming
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

MICROPROCESSOR BASED SYSTEM DESIGN Lecture # 19 - 20 BY PROF. DR. B. S. CHOWDHRY

INTERRUPTS Interrupts provide a mechanism for changing program environment. Transfer of program control is initiated by either the occurrence of an event internal to the microprocessor or an event in its external hardware. For instance, when an interrupt signal occurs indicating that an external device, such as printer, requires service, the microprocessor must suspend what it is doing in the main part of the program and pass control to a special routine (Interrupt service routine) that performs the function required by the device. When microprocessor terminates execution in the main program, it remembers the location where it left off and then it picks up execution with the first instruction in service routine. After this routine run to completion, program control is returned to the point where the microprocessor originally left the main body of program. Interrupts are particularly useful when interfacing I/O devices that provide data at relatively low data transfer rates.

INTERRUPTS (Contt..) Example: If the person using the keyboard typed one character per second, the software for 8255 PPI waits on entire second between each keystroke for the person to type another key. This process is such a tremendous waste of time that designers have developed another process called Interrupts Processing to handle this situation. Interrupts processing allows the microprocessor to execute other software while the keyboard operator is thinking about what key to type next. As soon as key is pressed, the keyboard encodes de-bounced switch and puts out one pulse that interrupts the microprocessor. In this way, microprocessor executes other software until the key is actually passed when it reads a key and returns to the program that was interrupted. As a result, the microprocessor can print reports or complete any other task while the operator is typing a document and thinking about what to type next.

Figure 1 shows a time line that indicates a typist typing data on a keyboard, a printer removing data from memory, and program executing. The program is the main program that is interrupted for each keystroke and each character that is to print on the printer. Note that the keyboard interrupt service procedure, called by the keyboard interrupt, and the printer interrupt service procedure each take little time to execute. The 8086/8088 micro-computer are capable of implementing any combination of upto 256 INTERRUPTS.

They are divited into four groups: External Hardware Interrupts Software Interrupts Internal Interrupts Non maskable Interrupts The interrupts of the entire Intel family of microprocessors include: Hardware pins that request interrupt (INTR & NMI) and one hardware pin (INTA) that acknowledges the interrupt requested through INTA. In addition to the pins, the microprocessor also has software interrupts INT, INTO, INT3, and BOUND. Two flag bits, IF (Interrupt Flag) and TF (Trap Flag), are also used with the interrupt structure and a special return instruction IRET (or IRETD in 80386/higher). Hardware, software, and internal interrupts are serviced on priority basis.

Internal interrupts are the highest priority group. Next lowest is the non-maskable interrupt. Next lowest is the software interrupts. External hardware interrupts are the lowest priority group. Even within a group, various interrupts are given different priority levels. (Type 0 identifies the highest priority internal interrupt and Type 225 identifies lowest priority internal interrupt).

INTERRUPTS VECTORS The interrupt vectors and vector table are crucial to an understanding of hardware and software interrupts. The Interrupt vector table is located in the first 1,024 bytes of memory at addresses 000000H – 0003FFH. It contains 256 different four-byte interrupts vectors. An interrupt vector contains the address (Segment and offset) of the interrupt service procedure. Figure 2 illustrates the interrupt vector table for the microprocessor.

INTERRUPTS VECTORS (Contt..) Intel reserves the first 32 interrupt vectors for their use in various microprocessor family members. The last 224 vectors are available as user interrupt vectors. Each vector is 4 bytes in length and contains the starting address of the interrupt service procedure. The first two bytes of the vector contain the offset address and the last two bytes contain the segment address.

INTERRUPTS VECTORS (Contt..) The following list describes the function of each dedicated interrupt in the microprocessor: Type O-Divide Error: Occurs whenever the result of a division overflows or whenever an attempt is made to divide by zero. Type 1-Single-Step or Trap: occurs after the execution of each instruction if the trap (TF) flag bit is set. Upon accepting this interrupt, the TF bit is cleared so the interrupt service procedure executes at full speed. Type 2-Nonmaskable Hardware Interrupt: a result of placing a logic 1 on the NMI input pin to the microprocessor. This input is non-maskable which means that it cannot be disabled.

INTERRUPTS VECTORS (Contt..) Type 3-One Byte Interrupt: is a special one-byte instruction (INT 3) that uses this vector to access its interrupt service procedure. The INT 3 instruction is often used to store a breakpoint in a program for debugging. Type 4-Overflow: is a specia1 vector used with the INTO instruction. The INTO instruction interrupts the program if an overflow condition exists as reflected by the overflow flag (OF). Type 5-BOUND: is an instruction that compares a register with boundaries stored in the memory. If the contents of the register is greater than or equal to the first word in memory and less than or equal to the second word, no interrupt occurs because the contents of the register is within bounds. If the contents of the register is out of bounds, a type 5 interrupt executes. Type 6-lnvalid Opcode: occurs whenever an undefined opcode is encountered in a program.

INTERRUPTS VECTORS (Contt..) Type 7-Coprocessor Not Available: occurs when a coprocessor is not found in the system as dictated by the machine status word (MSW) coprocessor control bits. If an ESC or WAIT instruction executes and the coprocessor is not found, a type 7 exception or interrupt occurs. Type 8-Double Fault: is activated whenever two separate interrupts occur during the same instruction. Type 9-Coprocessor Segment Overrun: occurs if the ESC instruction (coprocessor opcode) memory operand extends beyond offset address FFFFH For 286 & Higher Type 10-lnvalid Task State Segment (TSS): occurs if the TSS is invalid because the segment limit field is not 002BH or higher. In most cases this is caused because the TSS is not initialized. Type 11-Segment not Present: interrupts occur when the P bit (P = 0) in a descriptor indicates that the segment is not present or not valid. Type 12-Stack Segment Overrun: occurs if the stack segment is not present (P = 0) or if the limit of the stack segment is exceeded.

INTERRUPTS INSTRUCTIONS A number of instructions are provided in the instruction set of the 8086/8088 microprocessors, for use with interrupt processing.

INTERRUPTS VECTORS (Contt..) Type 13-General Protection: occurs for most protection violation in the 80286/ 80386/80486 protected mode system. A list of these protection violations follows: descriptor table limit exceeded privilege rules violated invalid descriptor segment type loaded write to code segment that is protected read from execute-only code segment write to read-only data segment segment limit exceeded Type l4-Page Fault: occurs for any page fault memory or code access in the 80386 and 80486 microprocessors. Type l6-Coprocessor Error: takes effect whenever a coprocessor error (ERROR= 0) occurs for the ESCAPE or WAIT instructions for the 80386 microprocessor only.

INTERRUPTS INSTRUCTIONS (Contt..) Use of software interrupt instruction INT n. INT n is used to initiate a software call of subroutine. Executing the instruction causes transfer of program control to the subroutine pointed to by the vector for type number n specified in the instruction. Example: INT 50 initiates execution of a subroutine whose starting point is identified by vector 50 in the pointer table. That is, the microprocessor reads IP50 and CS50 from address 000 C816 and 000CA16, respectively, in memory, loads these values into IP and CS, calculates the physical address, and starts to fetch instructions from this new location in program memory.