Electronic – after programming PIC, can no longer run debug or reprogram

mplabpic

OK, I have written a few basic programs in MPLABX C18 for both 18f4550 and 18f46k20. Eventually got them to compile and test/debug correctly and run on the PIC. After I choose, "make and program device" It works but I can no longer run debug or re-program the chip. Always says the device doesn't match, etc. Here is what the output window says:


Connecting to MPLAB ICD 3…
Firmware Suite Version…..01.28.07
Firmware type…………..PIC18F

Target detected
Device ID Revision = 7

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x1ff
configuration memory

Programming…
program memory
Address: c Expected Value: 6a Received Value: 36
Failed to program device


Any ideas?

Thanks

Best Answer

The PIC may have been told to 'raise its shields' or may have been programmed to not respond to the programmer clock or oscillator control network. These problems are usually recoverable by following a suitable path. A circuit diagram of your target application may be useful.

Without looking at your specific PIC:

You may have code protection set.
The device should be able to be erased with code protection set.

You may have selected a clock type that the programmer does not support.
Worst case if it is not seeing your programmer clock or crystal you may have to uses ICSP with the PIC in a breadboard and supply a clock source or crystal or resonator or RC network or whatever that allows the PIC to run so it can listen to the programmer well enough to find its way home.

There is a small chance that it has been damaged in the process and is irrecoverable. Be sure to use adequate anti-static precautions and correct operating voltages, insert and remove with power off, ensure that no signal levels exceed absolute maximum values.