Does anyone know of a way to get an AVR processor out of the condition where it refuses to respond to serial programming commands? This frequently happens when a programming process aborts for any reason. With DIL chips I can either throw the chip away and replace it, or I can sometimes revive it by plugging it into another circuit and programming it there. With surface mount it is either a case of major surgery to replace the chip, or a whole board needs to be trashed.
I have just had a Mega168 do this to me. First it programmed about 2/3 of the memory, then for the rest it returned the least-significant byte of the address instead of the verified data. I tried halving the clock speed but then it only programmed about 1/3. Then it initialised and (apparently) erased but would not program anything, and finally it would not initialise at all (I can't even get the $53 reply to the initial set-up).
I've tried slowing the clock right down, and/or upping the VCC from 3V to 5V (this has sometimes worked in the past), but no good. It looks like I've got a dead board, and I'm wondering how many more boards I will end up wrecking in the process of debugging the programming interface.
This particular chip has been programmed before using a tried and tested programmer, and had run the program successfully for weeks. Also, the new programming interface has worked successfully in breadboard form, programming a DIL version of the Mega168 many times, and it has also successfully programmed the chip which is now faulty at least once.
Does anyone have any experience of getting out of this problem?