Memory Corruption - "Programming/Verify Complete", but Subsequent "Verify" Fails

If you are using MPLAB® X IPE and a Microchip programmer (PICkit™ 3, MPLAB ICD3 or MPLAB REAL ICE™ In-circuit emulator) and the device is programmed correctly (Programming/Verify complete) but subsequent Verify operations fail (even though the device is not code protected), it is possible that the code itself is writing to the flash or electrically erasable programmable (EEP) memory. This happens because MPLAB X IPE doesn't keep the device in reset after programming.

The MCLR goes from high to low to high depending on the programming process. The PIC® is erased, programmed and verified before the electrically erasable programmable read-only (EEPROM) is programmed and the MCLR goes low and high in between these steps. To avoid the EEPROM data being corrupted, we recommend adding a delay before the EEPROM write. The delay should be longer than the duration of MCLR in a high state so that the EEPROM is not written into before the verify happens.

© 2018 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.