Hi,
I've finally gotten HV programming to work. There was a problem with the a circuit on MCLR. We have an open collector implementation of controlling Mclr via the CPLD. This way we can set it at 5V or the ICD 2 to raise it to 13Vpp for Hv programming. The problem is the ICD 2 was isolated from this open collector tranistor via a diode, and was never able to provide a ground on the nMCLR pin for the PIC. If the open collector transistor was on then nMCL would always see 0V and the ICD2 could not overide it. When it was off, the nMCLR line was pulled to 5V. So I guess when the device was never programmed the 5V to Vpp on nMCLR was o.k to get it into program/Verify mode but after the device was programmed, the code would have already been executing before nMCLR was pulled ot vpp. I've currently removed the 5V pull-up that was connected to the open collector transistor, and by-passed the diode in the circuit so that ICD 2 can provide a ground on nMCLR (on pic pin not header pin). At least this way I can LVP and and HV program (erase part), to try and debug why once I have programed in lvp I cannot get back into lvp mode. Since I can connect know with ICD 2, I've dumped the memory contents to file and the confiugration bits look fine 0x3FAA.
I've finally gotten HV programming to work. There was a problem with the a circuit on MCLR. We have an open collector implementation of controlling Mclr via the CPLD. This way we can set it at 5V or the ICD 2 to raise it to 13Vpp for Hv programming. The problem is the ICD 2 was isolated from this open collector tranistor via a diode, and was never able to provide a ground on the nMCLR pin for the PIC. If the open collector transistor was on then nMCL would always see 0V and the ICD2 could not overide it. When it was off, the nMCLR line was pulled to 5V. So I guess when the device was never programmed the 5V to Vpp on nMCLR was o.k to get it into program/Verify mode but after the device was programmed, the code would have already been executing before nMCLR was pulled ot vpp. I've currently removed the 5V pull-up that was connected to the open collector transistor, and by-passed the diode in the circuit so that ICD 2 can provide a ground on nMCLR (on pic pin not header pin). At least this way I can LVP and and HV program (erase part), to try and debug why once I have programed in lvp I cannot get back into lvp mode. Since I can connect know with ICD 2, I've dumped the memory contents to file and the confiugration bits look fine 0x3FAA.