Embedded Priority Interrupts

Jump To:
Interrupt Theory
           The interrupt theory will be split into two sections. The first part will look at how interrupt are split into priorities on a theoretical basis and the second part will give an overview of how to setup interrupts for priority levels on the PIC.

Priority Interrupts

Two Types Of Interrupts
           The PIC has two different types of interrupts: High Priority and Low Priority. The picture above illustrates those interrupt states along with the main program loop. The 3 different processes that can occur during three different circumstances are:
  •           Main Program Loop
  •           High Interrupt Priority
  •           Low Interrupt Priority
The main program loop process happens whenever no interrupt has been triggered. This is the majority of the time. The High priority interrupt occurs whenever the push-button triggers it. The Low priority interrupt also occurs whenever the push-button triggers it, however just like the main loop, the low priority interrupt service routine (ISR) can be interrupted by the high priority interrupt.

PIC External Interrupt

           The type of hardware interrupt that this tutorial will use is called an interrupt-on-change. There are two types of 'changes' that we can set the interrupt for, either a rising edge change which would be +0v to +5v or a falling edge change which would be a +5v to +0v. We will be using the falling edge setting. So when the push button is pressed, the PIC's RB0/RB1 pin will change from +5v to +0v and a hardware interrupt will be triggered.



;