I'm accustom to programming PICs in a socket like the Picstart plus. To enter the 21st century, I got a used PICkit3 and tried ICSP.
So far, not so good. Is it me or the PICkit?
I soldered a 16f883 to a breakout board with a decoupling cap, bulk cap and a LED/resistor tied to one pin. The Vpp, PGC, PGD pins are only connected to the PIC and less than an inch away. Continuity all checks out. Configuration is setup to use the internal oscillator and MCLR is internally tied to VDD.
Although the Vdd and ground pins are connected to the PIC, I powered the 'target' from a bench supply(5V). Made sure that the "Power target circuit from PICkit3" checkbox was unchecked before doing that. MPLAB shows a 5.0V on the PICkit3.
It worked for a dozen times, then started giving me errors. "Target ID not expected value"... even though it's the same value (all zeros) that it was when it was working.
I looked at the programming lines and they look correct, I think. I see Vpp ramp up to 13V then a few milliseconds later I see a burst on the data and clock lines.
The user manual talks about excessive capacitance on the Vdd line. The other lines I can understand, but if I'm powering the target from a bench power supply, why should this matter?
I removed power to the target and used the PICkit3's power, it worked a couple times. Now it appears completely random.
Do I need anything else, or should I simply be able to power a PIC with an external 5V supply, and attach the unused pins to the PICkit?
Does the MCLR/Vpp pin need a pullup to Vdd as in their chart? Does the PGM pin need tied to ground?
Edit: Swapped out the PIC for a new one and removed the bulk cap. The Target ID is still all zeros, but MPLAB doesn't give an error. Very odd.
Appears to work better without the bulk cap... not sure why that's an issue as I have it powered for at least a minute before programming.
SOLVED: PGM pin needs pulled low when using a PICkit to program. Contrary to datasheet, it doesn't matter what config bits are set.