Most likely you are having brown out problem. Try enabling brown out reset. PIC needs some minimum voltage to support 8MHz operation. It seems you have 100uF capacitor on Vdd. During power down situation, it may take some time for it to discharge fully. This may create a situation where PIC is powered with a Vdd that is outside the V/f spec. If you violate the V/f spec then you cannot rely on proper code operation. If instruction read from the Flash gets corrupted then you may see the problem you are describing. i.e. EEPROM write function is interpreted as Flash write (just one RAM bit gor corrupted). The BOR circuit is a tool to protect against violation of V/f spec. Enable the on-chip BOR circuit and test it. If it fixes the problem then it was related to V/f spec violation during power up/ down situation. Hope this helps -- View this message in context: http://www.nabble.com/-PIC--16F-parts-flash-being-corrupted-in-power-cycles-tf2017533.html#a5643103 Sent from the MicroControllers - PIC forum at Nabble.com. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist