ECE3120: Computer Systems Chapter 6: Interrupts - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

ECE3120: Computer Systems Chapter 6: Interrupts

Description:

I/O completion, timer time-out, illegal opcodes, arithmetic overflow, divide-by-0, ... mechanism establishes these initial conditions for the computer system. ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 9
Provided by: xubi
Category:

less

Transcript and Presenter's Notes

Title: ECE3120: Computer Systems Chapter 6: Interrupts


1
ECE3120 Computer SystemsChapter 6 Interrupts
  • Dr. Xubin He
  • http//iweb.tntech.edu/hexb
  • Email hexb_at_tntech.edu
  • Tel 931-3723462, Brown Hall 319

2
  • Prev
  • Parallel Ports
  • Today
  • Concepts of Interrupts

3
Fundamental Concepts of Interrupts What is an
interrupt? A special event that requires the CPU
to stop normal program execution and perform
some service related to the event. Examples of
interrupts include I/O completion, timer
time-out, illegal opcodes, arithmetic overflow,
divide-by-0, and so on. Functions of
Interrupts - Coordinating I/O activities and
preventing CPU from being tied up - Providing a
graceful way to exit from errors - Reminding the
CPU to perform routine tasks Interrupt
Maskability - Interrupts that can be ignored by
the CPU are called maskable interrupts.
A maskable interrupt must be enabled before it
can interrupt the CPU. An interrupt is enabled
by setting an enable flag. - Interrupts that
cant be ignored by the CPU are called
nonmaskable interrupts.
4
Interrupt priority The order in which the CPU
will service interrupts when all of them occur at
the same time. Interrupt Service The CPU
provides service to an interrupt by executing a
program called the interrupt service
routine. A complete interrupt service cycle
includes 1. Saving the program counter value
in the stack 2. Saving the CPU status
(including the CPU status register and some
other registers) in the stack 3.
Identifying the cause of interrupt 4. Resolving
the starting address of the corresponding
interrupt service routine 5. Executing the
interrupt service routine 6. Restoring the CPU
status and the program counter from the
stack 7. Restarting the interrupted program
5
Interrupt Vector Starting address of the
interrupt service routine Interrupt Vector
Table A table where all interrupt vectors are
stored. Methods of Determining Interrupt
Vectors 1. Predefined locations (8051
approach) 2. Fetching the vector from a
predefined memory location (68HC12) 3. Executing
an interrupt acknowledge cycle to fetch a vector
number in order to locate the interrupt vector
(68000 and x86 families) Steps of Interrupt
Programming Step 1. Initializing the interrupt
vector table Step 2. Writing the interrupt
service routine Step 3. Enabling the interrupt
6
  • The Overhead of Interrupts
  • Saving and restoring of CPU status and other
    registers. (68HC12 needs to save all
  • CPU registers).
  • The execution of the RTI instruction that will
    restore all the CPU registers.
  • Execution time of instructions of the interrupt
    service routine.

7
Resets - The initial values of some CPU
registers, flip-flops, and the control registers
in I/O interface chips must be established in
order for the computer to function
properly. - The reset mechanism establishes these
initial conditions for the computer
system. - There are at least two types of resets
power-on reset and manual reset. - The power-on
reset establishes the initial values of registers
and I/O control registers. - The manual reset
without power-down allows the computer to get out
of most error conditions if hardware does not
fail. - A reset is nonmaskable.
8
Next
  • 68HCS12 exception processing
Write a Comment
User Comments (0)
About PowerShow.com