Here's a quick tip for you. Every time you use a microcontroller (like PIC, AVR, anything for that matter) in your project, you'd definitely have a main loop that keeps looping the entire time. So, the best way to know if your microcontroller is indeed working and that it has not reset itself or done something funny, is to just toggle an output at the end of the loop. You can connect this to an LED with a resistor. Below is sample Assembly code for PIC.
(some code here)
BTFSC PORTB, 7
BSF PORTB, 7 ;turns on LED
BCF PORTB, 7
The LED connected to the 8th bit of PORTB keeps toggling after every loop, so you can tell whether the microcontroller is executing the program and is not stuck.