Mega 2560 - can't program - OS X, USB

Hi,

Started to use a new Mega 2560 yesterday and receive this from the Arduino IDE when I upload (OS X, 10.11.5):

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: verification error, first mismatch at byte 0x009a
         0xc0 != 0x00
avrdude: verification error; content mismatch
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x11
avrdude: stk500v2_disable(): failed to leave programming mode
the selected serial port avrdude: stk500v2_disable(): failed to leave programming mode
 does not exist or your board is not connected

And various errors in other attempts.

I've done the loopback test and it succeeds.

I've done the RESET test and LED does not blink afterwards.

It all sounds like there is no board firmware loaded?

What is the best way to load it? I'm considering using Nick's loader, with the ICSP cable, from a working Duemilanove I have here.

--Toby

Under Tools menu did you select the right board and port? Also try using a different USB cable, I found really cheap one can fail to work.

The USB cable I am using works fine with the Due.

Yes I am using the right board and port.

I tried Nick Gammon's programmer, using a programming cable (reset -> D10 on the running Due).

The first attempt it seemed to recognise the Mega, and I could even attempt to program it. However it failed verification completely, and then after that, I cannot even get it to "enter programming mode" in many attempts.

Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Sep 29 2017 at 22:26:54 with Arduino IDE 10804.
Attempting to enter ICSP programming mode ......................................................
Failed to enter programming mode. Double-check wiring!
Type 'C' when ready to continue with another chip ...
Attempting to enter ICSP programming mode ......................................................
Failed to enter programming mode. Double-check wiring!
Type 'C' when ready to continue with another chip ...

When the Mega is plugged into ICSP it powers up with the ON and LED next to AREF permanently lit.

Looks like it is bricked, or was a brick when I bought it from ebay.

Does anyone know what kind of diagnosis I could do? I don't mind writing my own code to probe ICSP etc. Is it possible to make use of this board at all or will I just have to throw it away?

Can you try burning a Mega bootloader via ICSP? Maybe it wasn't programmed right?

I was trying to burn the bootloader over ICSP using Nick Gammon's sketch.

Does anyone know if it's possible to unbrick or test the Mega?

When I turn it on, both LEDs light, and there's no response to grounding RESET.

The Due is a 3.3V device, the Mega a 5V device; I hope you did not damage your Due.

If the Mega is still recognised by the PC, you first can try the loopback test. If that works, get an Uno and burn the bootloader.

Can you expand on "The Due is a 3.3v device"? The Due has +5V regulated on the board and that's what its ICSP interface offers. Its GPIO is all 5V output.

From the Due page; I have added the highlight

Warning: Unlike most Arduino boards, the Arduino Due board runs at 3.3V. The maximum voltage that the I/O pins can tolerate is 3.3V. Applying voltages higher than 3.3V to any I/O pin could damage the board.

I'm sorry, the confusion is my fault. I was using "Due" as short for "Duemilanove". I didn't realise there was actually a separate product named "Due".

To be clear, I'm using a Duemilanove.

So, is the Mega 2560 a brick? Any way to troubleshoot it further?

Loopback test still works, fwiw.

Sorry, should have read your first post better where you indeed mentioned the Duemilanove.

And sorry, can't help further.

I've also tried using the Arduino as ISP method, but it's a bit unclear whether this is supposed to be able to burn the Mega 2560 bootloader.

In any case, any attempt to upload a sketch fails like this ("Upload Using Programmer" with Programmer set to "Arduino as ISP", and the ArduinoISP Example sketch running on the Duemilanove):

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x15
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x15

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12
the selected serial port avrdude: stk500_disable(): unknown response=0x12
 does not exist or your board is not connected

Trying to "Burn bootloader" produces the same result.

I grabbed a SparkFun Pocket Programmer to try and confirm the issue. I see this output:

$ avrdude -c usbtiny -p m2560 -v

avrdude: Version 6.3, compiled on Mar 15 2016 at 21:26:45
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/usr/local/Cellar/avrdude/6.3/etc/avrdude.conf"
         User configuration file is "/Volumes/ElCap/Users/x/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: 061:001
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

I guess the USBtiny isn't even able to burn a bootloader to this device.

I wonder if it could be bricked by fuses?

Sounds like the Mega has a dud CPU.

I'm going to give it one more shot with a real AVR ISP programmer, but yeah, not optimistic.

Yeah, trying with a Pololu programmer:

$ avrdude -p m2560 -c avrisp2 -P /dev/tty.usbmodem00143251 -U flash:w:Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex.txt

avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Board seems to be toast.