I’ve got trouble with my Arduino Mega2560 because of 12v short to Digital pin 24. It was like 3 or 4 seconds and when I realized, Both ATMEGA2560 and ATMEGA16U2 where hot. But not that hot to burn finger so there was not any kind of smoke or Chip burning smell.
Now the hole device is unknown to computer. When I put the USB nothing happens!! Totally nothing.
So I took my AVR USBasp programmer and started testing chips.
ATmega16U2: i wrote a program by Codevision so it was able to blink rx&tx LED’s whit delay and… so the chip is healthy
ATmega2560: I can run any program that I want. But not work with “Upload using programmer” in Arduino’s program. I should find the .HEX in windows temp files and burn it to the chip directly by ProgISP.
So 1- what is the problem? the Chips are healthy
2- Did I erase bootloader because of direct programming?
3-just the USB section of ATmega16U2 might be fried that made it unrecognizable to PC. Is this possible?
4-the picture I attached, i should mark “BLANK CHECK” when i burn it. Otherwise the chip do nothing! Why?
If you use an ISP programmer to write a user program to the ATmega2560, it will not run unless you unprogram the BOOTRST fuse. The normal fuses have BOOTRST set and that would run the bootloader. When you upload a program, the bootloader is erased. So yes, you need to put the bootloader back onto it to use the board normally again. That stuff is discussed a little here:
I suggest use your programmer to program the correct fuses and bootloader on the ATmega2560. If you use the IDE's burn bootloader function, it uploads the bootloader and sets the fuses according to what is in the boards.txt file that is part of the IDE. In the IDE preferences if you check show verbose output on upload, you will see the avrdude commands it runs and the syntax, so you can use similar syntax on the command line to program the ATmega16U2.
Then switch to the ICSP header near the USB port and program the correct fuses on the ATmega16U2 and upload the Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex program onto it. That hex file is in one of the subdirectories of the IDE installation, so you already have it.
Fuses for the ATmega16U2 are: lfuse 0xFF hfuse 0xD9 efuse 0xF4
Reprogramming both chips and setting the fuses may fix the board for normal USB upload. Check and see if you have parts of the board getting hot under normal use, and if so it could be a matter of time before failure.