ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 11.

Slides:



Advertisements
Similar presentations
Chapter 3 Basic Input/Output
Advertisements

ECE 353 Introduction to Microprocessor Systems
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:
I/O Unit.
Unit 4 Chapter-1 Multitasking. The Task State Segment.
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 3: Input/output and co-processors dr.ir. A.C. Verschueren.
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
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.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
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.
1 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
Introduction to Interrupts
INPUT/OUTPUT ORGANIZATION INTERRUPTS CS147 Summer 2001 Professor: Sin-Min Lee Presented by: Jing Chen.
Interrupts – (Chapter 12)
Lecture 09: Interrupts & 8259.
Exception and Interrupt Handling
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
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
1 COMPUTER ARCHITECTURE (for Erasmus students) Assoc.Prof. Stasys Maciulevičius Computer Dept.
1 Microprocessor-based Systems Course 8 Design of input/output interfaces.
Interrupts, Part 1 Dr. Dimitrios S. Nikolopoulos CSL/UIUC
Interrupt.
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.
Microprocessors 1 MCS-51 Interrupts.
Lecture 09: Interrupts & The 80x86 IBM PC and Compatible Computers Chapter 14 Interrupts and the 8259 Chip.
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.
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.
Dec Hex Bin 14 E ORG ; FOURTEEN Interrupts In x86 PC.
8086 Interrupts and Interrupt Applications
14.2: x86 PC AND INTERRUPT ASSIGNMENT
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
University of Tehran 1 Microprocessor System Design Programmable Interrupt Controller Omid Fatemi
Microprocessor System Design Programmable Interrupt Controller.
بسم الله الرحمن الرحيم MEMORY AND I/O.
9/20/6Lecture 3 - Instruction Set - Al1 Exception Handling.
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.
The 8051 Microcontroller Chapter 6 INTERRUPTS. 2/29 Interrupt is the occurrence of a condition an event that causes a temporary suspension of a program.
BIOS and DOS Interrupts Basic Input /Outpu System Disk Operating System.
INTERRUPTS. Topics to be discussed  8088/86 Hardware Interrupts pins 8088/86 Hardware Interrupts pins   Pin description Pin description.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Computer System Structures Interrupts
An Interrupt is either a Hardware generated CALL (externally derived from a hardware signal) OR A Software-generated CALL (internally derived from.
Interrupts and exceptions
Interrupts and interrupt responses
MICROPROCESSOR BASED SYSTEM DESIGN
Microprocessor and Assembly Language
Microprocessor Systems Design I
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.
Anton Burtsev February, 2017
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.
Subject Name: Microprocessors Subject Code:10EC46 Department: Electronics and Communication Date: /20/2018.
11.1 Interrupt Mechanism, Type, and Priority
8259 Programmable Interrupt Controller
CNET 315 Microprocessor & Assembly Language
COMP3221: Microprocessors and Embedded Systems
Presentation transcript:

ECE 353 Introduction to Microprocessor Systems Michael J. Schulte Week 11

Topics Interrupt Concepts 80C188EB Interrupt Handling Hardware Interrupts 80C188EB Interrupt Control Unit (ICU) Interrupt Service Routines (ISRs) Interrupt Driven Systems Software Interrupts and Exceptions Interrupt Priority and Latency Interrupt Controllers Debugging Interrupt Hardware and Software

Why Use Interrupts? Maximize processor utilization and efficiency Allow use of sleep/idle states when nothing to do to save power Minimize latency in responding to complex input/output structures Facilitate event driven applications

Interrupt Primer Terminology Event – an occurrence that the processor must respond to Asynchronous events – events that occur at unpredictable times while program is running Pending interrupt – an IRQ signal has been received, but it has not been serviced yet. Interrupt Service Routine (ISr) – the code executed in response to an IRQ signal. Interrupt-driven I/O – I/O devices that use interrupts to signal when they require service Critical code section – a section of code that cannot be interrupted

Basic Interrupt Hardware

Types of Interrupts Maskable interrupt – an interrupt that can be disabled when desired Nonmaskable interrupt (NMI) – an interrupt that cannot be disabled. Level-sensitive interrupts – an interrupt request is said to exist whenever the IRQ signal is at the designated level Edge-sensitive interrupts – an interrupt is only recognized on the signal’s transition

Multiple Interrupt Sources Multiple interrupt sources handled by Polled interrupts - single ISR is invoked for all interrupts and ISR must check all the possible interrupt sources Vectored interrupts - each interrupt source is associated with a unique ISR and the processor hardware selects the correct ISR  The starting address of the ISR is obtained from a look-up table (vector table)  Interrupt processing begins at a fixed, unique location based on the interrupt source

Multiple Interrupt Structure

Interrupt Priority Priority schemes determine the order in which interrupts are serviced

Software Interrupts & Exceptions Software interrupts provide another mechanism for changing control flow Interrupt instructions – Often used by applications to communicate with OS  x86 features the INT instruction Exceptions – software interrupts that are invoked by some unusual condition  Division by zero  Page fault

80C188EB Interrupts

Interrupt Processing Sequence

Saved and Restored State State saved on interrupt Save restored with RETI

Interrupt Vector Table Each interrupt is identified by an 8-bit type code The interrupt vector table contain bit ISR starting addresses (IP, CS)  Starts at 00000h  Not relocatable in the 80C188  1024 bytes long (1KB) Structure

Initializing Interrupt Vectors movdi, INT_TYPE * 4 cli push ds xorax, ax movds, ax;segment 0000h movax, offset ISR_X mov[di], ax;load offset movax, seg ISR_X mov[di+2], ax;load segment popds sti

80C1888EB Hardware Interrupts Modular core interrupts INTR – Generated by ICU  Interrupt Enable Flag (IF)  STI / CLI NMI – Nonmaskable interrupt HALT – Causes CPU to stop Interrupt example Hardware Software (vector table)vector table

80C188EB ICU Performs synchronization and prioritization of interrupts to CPU (block diagram)block diagram Functions Masking (IMASK, PRIMSK)IMASKPRIMSK Priorities (TCU/SCU, INT0-1, INT2-4)TCU/SCUINT0-1INT2-4  Default Default Synchronization/prioritization (REQST, INSERV)REQSTINSERV External interrupts (INT0-1, INT2-4)INT0-1INT2-4 Internal interrupts (TCU/SCU, INTSTS)TCU/SCUINTSTS Polling interrupt sources (POLLSTS, POLL)POLLSTSPOLL

Interrupt Service Routines ISR prerequisites ISR implementation Context save Clear IRQ FF (if necessary) Allow nesting (if desired) Handle interrupt Clear INSERV bit Context restore IRET EOI register use (EOI)EOI Shared procedures and resources

Interrupt Driven Systems Foreground vs. background tasks Events determine order of execution

Software Interrupts & Exceptions INT instruction Exceptions Divide error Single-step Breakpoint INTO BOUND Invalid Opcodes ESC

Interrupt Priority and Latency Overall priorities and resolution Defaults INTR, NMI, and exceptions Interrupt timing Latency Response time 80C188EB ICU specifics

82C59A PIC 82C59A structure and capabilities Can be cascaded IBM PC used two of them to get 15 IRQ lines  Now usually part of chip set Prioritization schemes Fixed Rotating Hierarchical Interrupt Acknowledge Bus CyclesBus Cycles Run to get type number of interrupt source 82C59A handles placing data on the bus

Interrupt Issues Using periodic interrupts to perform iterative tasks What to do when good interrupts go bad… Software debugging Hardware debugging Real-time issues Inter-process communication (IPC) issues

In-Class Assessment Quiz What sort of safeguards might you need to design into NMI hardware? For the 80C188EB, describe what happens between an IRQ being asserted and the actual execution of the ISR. What are the differences between vectored interrupts and polled interrupts?

In-Class Assessment Quiz What is a ‘level-sensitive’ interrupt? What problems can arise when using a semaphore to control access to a resource used by the main program and an ISR? What 80C188 instructions help handle this? Draw a flowchart for a periodic (1 KHz) ISR that will be used to generate precise delays. Only a single word variable is to be used to communicate with the ISR.

Vector Table

Interrupt Example - Hardware

IMASK

PRIMSK

REQST

INSERV

POLL

POLLSTS

EOI

INTSTS

REQST

TCUCON, SCUCON

I2CON, I3CON, I4CON

I0CON, I1CON

ICU Latency and Response Time

Default Interrupt Priorities Interrupt NamePriority Level Exceptions/NMI1 Timer 02a Timer 12b Timer 22c Serial Receive3a Serial Transmit3b INT44 INT05 INT16 INT27 INT38 Letters indicate relative priority within a level

ICU Block Diagram

INTA Bus Cycles