I recently started a new project and routed my own PCB for that; as size is important, I - for the first time - used the TQFP32-variant of the ATMega328 (rather than the DIL-package).
So I routed and ordered my PCB, soldered everything on and ran a first check with a current-limited powersupply. Everything seemed fine, current draw was < 20 mA.
Then I flashed the arduino "ATmegaBOOT_168_atmega328.hex"-bootloader onto the chip, set the fuses, plugged in the powersuppy again and tried to programm it from within the IDE. While doing so (which didn't work btw) I had to realize that the Atmega heated up like crazy; so I disconnected it again and re-checked the fuses and the bootloader just to find that everything's right.
After some testing I finally replaced the bootloader with the project's hex-file itself; chip stayed cool, programm worked.
I was able to recreate that issue on a second board, too.
Are there any special settings for the TQFP-version?
Schematics (if needed) are here (in case someone checks them: I also built a "minimal version" where I didn't solder the RFM22B and the level shifter in - with the same result).
Thanks in advance,
Yen
(who already blew two ATMegas due to this issue )
Edit: Meh, wrong forum, sorry, saw that too late. Could some mod please move this? Thanks, Coding Badly.
I think the bootloader flashes the LED on Arduino pin 13 = PB5 on the ATMega. Your schematic shows that line going to a 74HC4050D, which I wouldn't expect to sink much current at all when the pin goes high. Other than the LED pin and the Tx USART pin I would expect the rest of the pins to be set to input, so nothing should be sinking or sourcing enough current to heat up the chip. I'd try debugging with no power to the RF chip. The other option is to go through the bootloader code to see if anything besides Tx and the LED pin are set to output.