Hi All,

just got the following reply from Microchip....

Could you please try out the following when you receive the message:
"Program Memory or EEPROM Data is protected. Reprogram the entire part. If Auto select memory areas and range on the Memory Ranges tab of the programmer settings
is enabled, it must be disabled before proceeding.."

Proceed to Programmer Menu -> Settings
There deselect ( don't select) Auto Memory Areas and Range.
Manually enter memory areas and range as follows:
Program Memory Start Address : 0
Program Memory End Address : 3fff
Select Program Memory
Select Configuration Bits
Select ID Locations
Select EEPROM Data
Select Erase All Before Program

Then try programming. Programming will take a while since the entire memory range is being programmed.

In addition try out the following:
Short the Vdd and AVdd pins of the microcontroller. Also separately short the Vss and AVss pins of the microcontroller. Now connect the capacitor between Vdd and Vss pins.
Ensure that the capacitor that you're connecting between Vdd and Vss is a low ESR capacitor such as tantalum. Start with 0.1uF value and if programming failures still arise, try increasing this value incrementally to a maximum of 10uF.


Will give that a try this evening to see if I get any success.