(This is the older material - click here - for current specification content)

6. Types of interrupt

So, an interrupt can stop the CPU from what it is doing and instead start it doing something else.

What would happen if a lot of interrupts happened at the same time? How does the CPU know which one to deal with first?

The CPU knows which interrupt to handle first because there are a hierarchy of interrupts. This is because some interrupts are more important than others.

The table below shows the priority from highest to lowest

Interrupt Priority
Interrupt Examples
Hardware commands

Reset Button pressed

Power Supply failure

Power-down command (screen off, hibernate etc)

These send a physical signal to the CPU via the interrupt chip.

Program / Software

Software is also allowed to issue interrupts to the CPU. For example software has detected that an error has occurred and will issue a software interrupt for the CPU to run some instructions to try to clear the error.

 

Timer

Some programs trigger a 'timer interrupt' for example a

data-logging application that *has* to read an input sensor every 1 second.

Or perhaps a screen recording application that has to read the next screen update.

Input / Output devices

Devices such as the keyboard and mouse demand attention. Otherwise, your mouse and keyboard inputs would never get a look-in! Other Input - Output devices include

  • Hard Disk
  • Optical Disk
  • Printer
  • Graphics tablet

So as you see, there are levels of interrupts that are more important than others. This is called the 'interrupt priority'

But they all do the same thing if they are allowed to do so - they suspend the CPU operation and tell it to start executing the relevant interrupt service routine.

 

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: Interrupt Priority

 

 

Copyright © www.teach-ict.com