Friday, 3 May 2013

INTERRUPT JOURNEY FROM HARDWARE TO SOFTWARE - 1



Interrupt is a very vast topic. This post is about How Interrupt is generated from Peripheral and routed to the processor. Exactly till we get an IRQ number.

INTERRUPT
    An event external to the currently executing process that causes a change in the normal flow of instruction execution, usually generated by hardware devices external to the CPU sometimes by software.

We will deal software interrupts and exceptions in a separate post.

Hardware interrupts are asynchronous in nature.

How it is asynchronous ? 

Interrupt will not wait for nay other CPU routine to complete. It can be raised even in the middle of CPU execution.

Interrupt Vs Polling

Polling is a technique used by CPU to check for events in the peripheral device in a periodic manner.

Pros:

Efficient if interrupts arrive frequently.

Cons:

Takes precious CPU time even when there is no request from external device.

Each hardware interrupt has an interrupt level, trigger, and interrupt priority.
The following sections describe various interrupt components:

The interrupt level defines the source of the interrupt and is often referred to as the interrupt sourceThere are basically two types of interrupt levels: system and bus. The bus interrupts are generated by the devices on the buses (such as PCI, ISA, VDEVICE, and PCI-E). Examples of system interrupts are the timer and Environmental and Power Off Warning (EPOW).

There are two types of trigger mechanisms, level-triggered interrupts and edge-triggered interrupts.
Level-Triggered: A level-triggered interrupt module always generates an interrupt whenever the level of the interrupt source is asserted.

2 comments:

  1. Hi Nagaraj,

    Nice post, only thing I'm not understanding is the way the peripheral connected or interfaced to the PIC. Is it through 8 IRR lines? it means we can connect only 8 peripherals to the PIC.

    ReplyDelete
  2. Hi Madhav,

    Actually we can cascade APIC and can have more peripherals. PICs often allow the cascading of their outputs to inputs between each other.

    ReplyDelete