wow i know this is an old thread but hopefully this will help someone else who’s having similar errors
-
Device heats up like crazy – CHECK YOUR POWER CONNECTIONS(!!!) AVR’s heat up like MAD when you have GND and VCC reversed. In fact, every time i make a power connection on a new board i put my finger in the chip so i can feel it heating up in the event i have a power line reversed or there’s a short. I’ve never experienced an AVR heating up ‘like crazy’ over anything other than VCC<–>GND reversal. if you disconnect the power line quickly you can save your chip, if it heats too much for too long it’ll be fried for good. Check with avrdude every time you experience the heating to ensure the chip is still OK – just type in $avrdude -c usbtiny -p atmega328p (substitute atmega328p for atmega1280 in this situation, and whatever applicable programmer). If the chip is still good you’ll see the [#######] 100% bar, if it’s fried you’ll get an initialization failure
-
Good chip, good connections, but still get initialization error: This is what i check when this happens
a-1.) Disconnect SPI devices that might be attached to your chip. I know specifically the 23K256 RAM will prevent you from programming the ATMega328…technically this shouldn’t be in the failure to initialize category, though…avrdude reports the device initializes but will show an unexpected device signature or fuse bit (i forget which)… either way arduino will not burn a bootloader because of the unexpected reading (it’s actually receiving response from the atmega, but reading from the 23k256).
a.) Check that you’re getting 5V at VCC and GND
b.) Check that the RESET line goes directly to the RESET pin. For debugging purposes i make sure the RESET pin is connected ONLY to the ICSP RESET line.
c.) Make sure you have good connection to the 16MHz crystal and two 22pF ceramic capacitors – the ATMega168, 328, and 1280 require the clock to be connected. You may get the [####]100% once in a hundred attempts without a clock, but it goes out of sync quickly. ATtiny’s don’t need a crystal.
d.) Check that MISO, MOSI, and SCK are making good connections and not miss-placed
e.) Try putting a 0.1uF capacitor (non-polar) in parallel with VCC and GND
f.) If all else fails, disconnect EVERYTHING from the chip except VCC, GND, RESET, MISO, MOSI, SCK, and crystal+caps (if atmega). People recommend connecting both all the GND pins and AVCC, which is probably good advice, but i’ve always had success connecting just one VCC and one GND. If you put a volt-ohm meter with short detector setting up to the GND pins you’ll find they’re tied together, same with VCC pins. having all of them hooked up just ensures constant power if one pin jiggles and loses connection for a millisecond. AVCC supplies voltage to power the internal ADC, which you don’t need it for SPI but it probably won’t hurt to connect it.
g.) still doesn’t work? connect another chip because yours is probably fried.
additional note – when you get the initialization failure, check the read device signature. if it’s 00000’s then the chip is not responding to avrdude’s request. if it’s reporting a device signature that’s just wrong then check the chip you typed in the avrdude command to ensure you selected the right one. if you’ve selected the right one, make sure no slaves are present on the SPI bus. if the microcontroller is the only chip connected, make sure there are no current leaks or other sources for interference that would garble the MISO (Master-IN, Slave-OUT) line because the signal being sent from the mcu might be getting interference which would flip bits resulting in distorted bytes coming in to avrdude which would mean wrong values.