Been doing a lot of experimental programming on a PIC16F648A. This morning when i fired up the MPlab PICkit3, and target board,i got a message like "Device mismatch target id 0000 0000 does not match expected device id 0000 1100". So now it cannot be erased.
I've had that a few times for one of two reasons - either the programming header has a poor connection or the PIC is dead, probably static damage via the programming header.
Just recently I had a PICkit3 die on me, and I wasn't knowingly abusing it at the time. MCLR line does not go above VDD any more. Strangely, the circuitry inside the PICKit3 connected to the programming pins seems ok, but there is no drive signal to R23 of the dead PicKit3.
I have had something like that happen due to contaminants from soldering and handling, especially in the presence of high humidity. Try cleaning the board with flux remover (alcohol) followed by detergent and hot water, rinse, and hot air to dry thoroughly.
I tried a better temperature and time: 200F and one hour. Looks perfectly good. NO device complaints. I used the ASS-u-ME-ption that a static charge was stored and holding one or more gates at a fixed level. So, this simply anneals out the damage, and the higher temperature allows a more free flow of stored charge.
Was the problem fixed only while the device was at the elevated temperature, or was it also OK at normal temperature? The problem I had was leakage between pins and to other parts of the circuit on the soldered proto-board, and I could see some white deposits on the solder which was probably flux or salty contaminants that became conductive with humidity.
The programming pins, particularly PCLK and PDAT, are sensitive to loading and capacitance, so be careful about what is connected to them if you are using ICSP. Also, make sure that unused pins are terminated with a pull-up or other load, or programmed as an output. And be careful to set the ANSEL properly - the default is often analog and you must change that with the proper register bits.
Sometimes powering the device from the PICKit causes problems, especially if there is a voltage regulator on the board. It may help to set the device voltage a little lower if you have that option, to avoid drawing current through the output of the VREG. For small devices, I like to use DIP packages with sockets, so I can program the device out of the circuit. Microchip has a programming adapter with a ZIF socket, but it's easy to make your own.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.