...or possibly Watchdog Timer nipping your butt. Somehow it sounds like you are getting a Reset condition, or maybe a Brown-Out. Check your VDD supply voltage when it quits. If it isn't what you want (especially if it's below about 2.5 volts), you are getting a Brown-Out Reset Hold condition.
You should have a 4.7k (up to 10k) pull-up resistor on MCLR to prevent inadvertent hardware Reset. In your CONFIGs, turn WDT (Watchdog Timer) off. You can do this at program time with PBP.
Since it works on the Dev Board, you have something (or lack something) not the same as the Dev Board. Do you have a capacitor on the power supply to your PIC? Data sheets suggest a 0.1 uF cap RIGHT AT your VDD-to-VSS pins.
Hope this points you in the right direction.
Bookmarks