Mega328 heats up when flashed with bootloader

Hi *,

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 :frowning: )

Edit: Meh, wrong forum, sorry, saw that too late. Could some mod please move this? :blush: Thanks, Coding Badly.

Well, except for missing 0.1uF caps on the VCC, AVCC pins, I don't see anything immediately obvious.

Which forum would you like this moved to?

The 0.1uF-cap is in the lower left (and it's right next to the ATmega in the layout, too).

"Coding Badly" already moved the topic here, it's been in "Suggestions for the Arduino Project" at first; but thanks. :slight_smile:

There should have been 3 caps, one for each of AVcc, Vcc, and Vcc.
Still, I don't see that as the reason for overheating.
Sorry I can't offer more.

Okay, I'll take that into consideration for the new revision; thanks (I previously copied the basic schematics from the Arduino Pro Mini schematics).

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.

I already unsoldered the HC4050 and the RFM22 - still heated up :frowning:

But I think I'll really check the bootloader-code :confused: