haven't checked through your code, or the device datasheet, but here are some thoughts on possible gotchas. MCLR - using it as an input, or as reset? Is it being pulled high by a resistor if using it as a reset? LVP - do you have the chip set to use Low Voltage Programming? If so, is the PGM pin tied an appropriate way while in run mode? Sufficient bypass caps on the 5V? recommend a 100nF at the PIC, and some bulk capacitance nearby (4.7 to 10uF probably). Is the 5V line stable - if not the chip may be going into Brownout mode. Do you have Brownout Mode enabled? If so it would be worth disabling it. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist