this is a great PIC External Interrupt Sample Code for learning purpose. In this program, by applying a falling-edge signal to the INT0 pin, the program increases a variable. And in the while loop, displays this variable on the PORTB.
download the project here.
Also, don’t forget to checkout our Ultimate AVR Project Pack.