avrdude upload successfully but Mega2560 not running

Hallo guys, my Mega2560 was fried by an input voltage of 19volts into the external connector.
Removing the voltage regulator I was able to use it powered by USB with my fully functional already installed Sketch.

Unfortunatly my PC stopped recognizing my Mega. I think that is not due to the missing voltage regulator, but probably I fried the FTDI also.

So I was unable to upload new sketches to the mega.
I tried to use an Arduino Uno as FTDI bridge to my Mega (removing the ATMega from the Uno, connect Tx-Tx Rx-Rx, ... ) but no success... the IDE give me an upload timeout.

So i decided to try the ICSP way: I installed ArduinoISP on my Uno (from IDE version 1.6.5), linked pins 10 (Uno) to reset (Mega), 11 to ICSP4, 12 to ICSP1, 13 to ICSP-3, ground to ICSP Pin6 and 5V to ICSP Pin2.
I took the HEX of the same sketch that was running before on the mega and I used avrdude (v 5.10) to upload to the Mega.
At the end of the process Avrdude told me that all was fine (erase chip, read hex, write flash, verify, ....).

Unfortunatly now the mega doesn't execute the sketch... what is wrong?!?

I run avrdude with the following option:
avrdude -P COM3 -b 19200 -c avrisp -p m2560 -u -U flash:w:"Sketch.cpp.hex":i

any idea? thank you

Hi, welcome to the forum.

When you write that the Mega doesn't execute the sketch... then I wonder, what was not executed ?
Could you blink a led ?
If you can use a programmer to the ICSP header, at least those pins are still working.

The Mega uses a ATmega16U2 chip for usb-serial. It seems it is broken. If you use the Uno, you have to connect the RESET as well, and hope that the Uno can override the usb-serial chip (that is probably not the case).

To upload a sketch : GND, RX, TX and RESET are needed.
The DTR pin of the serial chip is used via 100nF to the RESET. It pulses the reset to make the bootloader start.

Why did it break so easy ? Is it an official Arduino board ?
Or was the 19V perhaps higher ? Nineteen volts, that might be a laptop adapter ?

What you have is a board that had a damaged voltage regulator, and a damaged usb-serial chip. There could be other things that are damaged, so the board will never be reliable. I think you have to buy a new one :money_mouth_face:

Thank you Peter,
Yes it was a laptop adapter but I tested the output voltage before: 19,05v... and yes this Mega is a China clone.

This evening I will try to upload a simplier sketch trought ICSP, but the strange thing is that after removing the regulator, the Mega was working correctly with the sketch preloaded before the damage.

AVRDUDE say that the verify process is ok (I already tryed with 10uF capacitor placed in pin 10 and ground on the Uno. With or without the capacitor I get the same result) so all seems to be ok... 'theoretically speaking'...

Try burning the bootloader using the same ICSP method you described above using the Arduino IDE.

First load the ArduinoISP sketch to the UNO.
Unplug the UNO and put a 10uF capacitor between ground and reset of the UNO.
Make the ICSP connections as above.
Plug in the UNO with it's MEGA tail.

In any sketch under tools make sure you select as follows :

  1. Board = Mega
  2. Port = Port UNO is connected on
  3. Programmer = Arduino as ISP
  4. Burn bootloader

After burning the bootloader (don't load the sketch) unplug the UNO and disconnect the Mega.
Plug the Mega into the USB port and see if it is recognised.

Let us know how u go.

Thank you asic,
bootlolader burned. The led on the Mega starts blinking.

Unfortunatly the Mega isn't recognized at all by the PC.

Is it possible to upload the sketch in the Mega throught the Uno with the same setup using the arduino IDE instead of avrdude?

Yes, in the menu is "sketch / upload with programmer", that uploads a sketch via the programmer using the ICSP header. The bootloader will be removed.

Strange, really strange... burning the bootloader the led starts blinking.
When I burn a sketch (even the simplest sketch like blink) the led stay fixed on.

I am near to raise the white flag :frowning:

What is the difference in the programmer option between "ArduinoISP" and "Arduino as ISP"?

Is there a difference ?

The Arduino as ISP or ArduinoISP is an Arduino board (often the Arduino Uno) that behaves like a programmer after the ArduinoISP sketch it uploaded to it.

Then came the “ArduinoISP board” and that started the confusion, because that is now also referenced as “ArduinoISP” :stuck_out_tongue_closed_eyes:
They should have called it “FabISP version 2” or something like that.

Thank you for the clarification.

Here my simple setup… I think it’s ok :confused:


I have not seen it like that.
Here is a tutorial, it comes with it's own programmer sketch, and the picture have text that say which is which : Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer
The 5V and GND are on the ICSP header as well, and pin 10 of the Uno should go to the RESET of the Mega. I think the Uno doesn't need the capacitor on the reset pin.

The ATmega2560 chip is programmed just like any other ATmega chip.
There can be some issues when a Arduino Mega 2560 is used as programmer, that's something else.

I already checked the gammon site.

My setup should be the same but on the UNO side I use the digital pins headers instead of the ICSP. This only because at the moment I have not female to female jumpers available

Sorry my suggestion did not work, there must be some damage.

I have a Nano which I partially fried, but I can still upload sketches via RX/TX using and FTDI programmer like this one.

A good tool to have around.

Looking at your setup pic, can u try it without the Uno-Pin 10 to MEGA-Reset link.
FWIW the Mega has a built in auto reset feature, so it may not be required.

Without Uno-Pin10 to Mega-reset I got the error "Programmer is not responding".

I think I will try again all the process one more time when I'll replace the voltage regulator even if I think this component is not involved in the upload process using this kind of connection.

In the meantime I'll order a new mega but if you have any new idea let me know: I need to Mount the mega in a box for a definitive project so It would not be a problem if the usb connection is not working, but I need to upload the sketch in some way...

thank you guys.