Here is something cool for those who are learning how to program a PIC microcontroller, and when they came across the PIC Interrupts felt totally helpless. Chris from pyroelectro uploaded a helping hand for you:
The goal of this tutorial is to build a system that has two types of outputs. One output will be the main program that flashes LEDs in a back and forth 'knight-rider' fashion. The second output will be triggered by an interrupt and should flash all the LEDs on and off a few times before exiting back to the main program.
In order to generate the interrupt, a standard push-button will be used. When the button is pushed, the PIC 18F452 microcontroller will sense the state change (from 5v to 0v) and issue a hardware interrupt to the software. The software will then pause the main program, execute the interrupt routine and return to the same spot in the main program.