I have an Arduino Mega 2560 R3 Board. And my problem is not unique: the Atmega2560 keeps heating up. There are serveral people experienced this, a quick google search gives a lot.
But there's a strange thing (I've recorded a short clip about this). For anyone who can't view it, I'll explain here: It heats up (anything still working normally) even without doing anything - Yes something had gone wrong because it should not even get warm when doing a bunch of work at 16Mhz. And the LED on pin 13 turns up. The more hot the controller, the lighter the LED is. When I attach a heatsink into it or touch it with my finger to cool it down, the LED dims, and to some point it turns completely off. But as soon as I release my finger out, the LED dim, and lights up.
At first I think it was a "feature" of the controller so I've downloaded the controller's datasheet here from Atmel. But after looking up 435 datasheet pages nothing finally came up. There is also topics about pin 13 lights up when not using, but turns out that it is associated with the internal timer. But the code I pushed to the controller is Bare Minimum. And to suppress the that warning LED I just have to
pinMode(13,OUTPUT); digitalWrite(13,0);
, somewhat annoying because it didn't used to have to.
So, had my controller gone wrong? I just can't believe it yet -
For a bit further info. The problem began several days ago when I solder out an old CRT monitor to get parts. I ended up with a lot of MOSFETS and a flyback. I don't have any 555 yet so I decided to use Arduino to generate a 10~15kHz pulse to make a tiny arc for the flyback. The first time I connected the gate pin directly to the board and got a good arc (I'm using a PSU driving the MOSFET with +12V and Arduino with +5Vsb). So I think I've burnt out something and then put a 100 Ohm resistor in series with the gate and the other pin. No difference with the arc but I realized the thing above happened. The arduino pin before has not dead yet - I could still do anything with it as normally.
The MOSFET I use is 7N60B from Fairchild (datasheet)
Pin 13 LED doing that is a feature. Your ability to make it dim or light up is related to your finger proximity to pin 13 on the mega chip, not on your finger cooling the chip. Pin 13 is floating because you don't have any code specifically setting the pin to output and setting a value. My Uno does this.
Um, my finger "actually pressed" the chip, and the heat it generates goes through my finger to cool down. It never used to be like that before! It's okay if it floats but back in the day when I received my Mega, I've uploaded the BareMinimum and the LED doesn't turn up anyway -
When a pin is floating, it may be near but not exceeding the voltage required for the attached device to consider it "on." Or it may stray a little bit over the voltage required for the attached device to activate. In this Mega 2560 R3 and Uno R3, the attached device is the buffer chip which runs the LED. The voltages and other characteristics of the buffer and the mega chip may fluctuate with things like age, wear, temperature, humidity, etc.
For experimenting it is often ok to let pins float if you are not otherwise using them as long as you are aware of it. For an experimenter's board such as an Arduino, as many pins as possible are left free (and floating) for the experimenter. In a final design of something non-experimental going into production, the engineer designing the circuit will often make sure nothing is floating; everything unused is either pulled up or pulled down or grounded, because the manufacturer wants everything to be known value and they don't want anything coming back to bite them from a support perspective.
Those floating inputs seen as random high & low also cause battery drain, so for battery powered applications make sure they high or low. Easy way is to just pull them up using internal pullups:
pinMode (pinX, INPUT_PULLUP);
So can I conclude that my Mega board is fine and there's nothing I could do about it. Just let it float - and put on the heatsink?? It's partly burned anyway.
Neither the ATmega2560 or the ATmega16u2 should get warm to the touch. If they do, they're damaged.
thevncore:
even without doing anything - Yes something had gone wrong because it should not even get warm when doing a bunch of work at 16Mhz.
Unless you are using sleep modes, the microcontroller is always doing something. It always fetching and executing code, even if it is just jumping back to the same address. So your notion of "doing nothing" only applies when you don't have power to the micrcocontroller.
thevncore:
The more hot the controller, the lighter the LED is.
Sounds like something is shorted.
thevncore:
At first I think it was a "feature" of the controller so I've downloaded the controller's data sheet
It's not.
thevncore:
The first time I connected the gate pin directly to the board
You should have used a current limiting resistor. The gate of a MOSFET is a small capacitor. It's very possible damaged the I/O pin, shorting it out. It's also very possible something else is damaged.
thevncore:
then put a 100 Ohm resistor
Too late.
thevncore:
arduino pin before has not dead yet - I could still do anything with it as normally.
I was doing debugging some x86 asm years ago (yes - I know it's not avr but it resemble x86 cisc in some ways) and I do know that "nothing" means keeping on nop'ing and jmp'ing to the earlier address. But to keep it simple because not anybody here is going to date with asm and hexes just to program it so I'll use "nothing" as anybody will know: { }
You're right. So: