[SOLVED] Mega2560 to burn bootloader on Mega2560?

What's the proper way to use a MEGA2560 to load a boot loader on another MEGA2560? I'm sure I'm doing something trivially wrong, but I don't know what.

I've tried the following:

  1. Successfully Flashed Arduino ISP onto a MEGA2560... let's call this "The Programmer"
  2. Environment:
  3. ArduinoIDE 1.8.8
  4. OSX Mojave
  5. Arduino IDE settings:
  • Board to MEGA2560
  • Processor to MEGA2560
  • Port to the "The Programmer"
  • Programmer to "Arduino ISP"
  1. Physical stuff:
  2. Connected the ICSP, pin for pin between the "the Target" and "The Programmer"
  3. The Programmer
  4. Placed a 10uF cap (Neg strip to Gnd) on Reset and Ground.
  5. Connected to the computer via USB
  6. The target board
  7. Connected to computer USB for power. (Powered via USB on computer)
  8. Clicked "Tools -> Burn Bootloader"
  9. Held down reset button on "The Target"
  10. Avrdude starts... output is as follows:
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega2560 -carduino -P/dev/cu.usbmodem146201 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/[REDACTED]/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbmodem146201
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         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 : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Seems, like it never flashed the boot loader.

Does anyone know what I maybe doing wrong?
Can a bootloader be updated, reburned?

I'm using a spare Mega2560, to try and burn a bootloader, ultimate goal, is to burn a bootloader on a RAMBo 1.3L board... which is also a atmega2560.

Any guidance would be appreciated.

I've tried a pololu 1300, firmware 1.08, to try this... but go no further then listed above...

1 Like

Try the following
1- choose "Arduino as ISP" instead of "ArduinoISP" I think you already did because it would give you a different error but just to make sure
2- the sketch for the ArduinoISP defines the ICSP (MISO, MOSI, SCK) pins to be 11, 12, 13 and assumes you are using an uno, change them to the ICSP pins found on mega 50, 51, 52 if I remember correctly or use an uno
3- connect the reset pin on your target board to pin 10 as the code pulls it to low from the beginning so you don't have to hold down the reset button
4- you are powering the target via USB and it is the same board so make sure you don't confuse them which I am sure you already checked but I had to point it out
5- don't smash your head to the wall out of frustration and good luck

1 Like

ISEN:
2- the sketch for the ArduinoISP defines the ICSP (MISO, MOSI, SCK) pins to be 11, 12, 13 and assumes you are using an uno, change them to the ICSP pins found on mega 50, 51, 52 if I remember correctly or use an uno

The ArduinoISP sketch included with any modern version of the Arduino IDE is set to use MISO, MOSI, SCK by default. You don't need to edit the sketch for that. It does have an option to use 11, 12, 13 on every board if you prefer that.

// By default, the hardware SPI pins MISO, MOSI and SCK are used to communicate
// with the target. On all Arduinos, these pins can be found
// on the ICSP/SPI header:
//
//               MISO °. . 5V (!) Avoid this pin on Due, Zero...
//               SCK   . . MOSI
//                     . . GND
//
// On some Arduinos (Uno,...), pins MOSI, MISO and SCK are the same pins as
// digital pin 11, 12 and 13, respectively. That is why many tutorials instruct
// you to hook up the target to these pins. If you find this wiring more
// practical, have a define USE_OLD_STYLE_WIRING. This will work even when not
// using an Uno. (On an Uno this is not needed).
1 Like

ISEN:
...

  1. yup.
  2. Looked at the code, and as Pert stated, it's set to that. Arduino 1.8.8.
  3. **** YES **** I think this solved it.
  4. yup.
  5. finally!!!

So, for anyone in the future, that's looking at this from a search engine.

  • Flash your MEGA2560, with the latest/modern Arduino ISP sketch. I used Ardiuno 1.8.8, File -> Examples -> 11 ArduinoISP. This board will be referred to as PROGRAMMER.
  • Disconnect PROGRAMMER board from power
  • Connect PROGRAMMER to the TARGET_BOARDthe ISCP header. 1=1, 2=2, etc... **** EXCEPT pin 5/RESET ****
  • Connect PROGRAMMER PIN D10 to TARGET board ISCP-RESET (pin 5).
  • Connect a 10uF (some say it's not needed, I used one) on the programmer on RESET and GND, neg strip to ground
  • Plug in the PROGRAMMER to the computer

Set your PORT to the PROGRAMMER's port
Set your Device to 2560
Set your Processor to 2560
Set your Programmer to "Arduino as ISP"

Click "Burn Bootloader"... and wait.

If it failed, try again. Worked the second time for me on my 2nd 2560...

Notes: I did not need to power up the TARGET 2560, while programming. Your mileage may vary.

1 Like