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:
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.
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.
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 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.