Turning brand new 328p-pu's into toasters

Hi folks, I've been playing with programming standalone microcontrollers for the past couple of years and have recently struck a problem that has me baffled. Whilst trying to bootload, and then program a 328p-pu (which I've done 100 times, using the same PC, same software, and same arduino UNO with a AVR ISP shield strapped to it) I found that my code would not run. So, as one would expect, I attempted to re-burn the program. The micro appeared to be a brick (no recogniton from the programmer, AVR dude errors etc) so I grabbed another micro and started again... Same result. After much testing, and several more bricked micro's I found I can burn the bootloader multiple times, I can burn "Blink" to the micro multiple times, I can not burn any of my more complex code to the micro without apparently killing it! If anyone has any ideas I'd be very happy to hear them... I'm at a complete loss.

What I've checked:- Uno programmed as AVISP, VCC set to 5V on AVRISP sheild, Bootload Board selected as Arduino/Genuino Uno, correct port, programmer selected "Arduino as ISP".

Thanks in advance.
Greg.

(deleted)

These are from a commercial supplier, not ebay.

(deleted)

The device I'm using is a commercially available shield that sits directly atop the UNO. It has ha ZIF socket for the micro and an onboard micro crystal. I have used it many times before with no problem. Is there any way I (or an update) could have changed a fuse setting in th Arduino ISP or AVR dude without meaning to?

(deleted)

so why does it write once? A broken programmer would just not write at all correct? I can write once, cook a chi, replace it with a nw one and write again...

How are set fuses of the newly programed chips? Try read it's memory back to see if it is the same as memory of old ones - programmed when it was working as expected.

I doubt they're damaged, just programmed wrong. Or, your program crashes, you just don't know it. What you haven't said is if you can read them. If you can, do as Samjdalf suggested and compare fuses settings with a good part.

If you have any type of ISP programmer, put the dud chip in a known good board and try reading with ISP and avrdude in console mode. You can learn a lot about the chip in that way.