# Arduino Mega2560 as ISP to program another Arduino Mega2560

**URL:** <https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580>\
**Category:** 3rd Party Boards\
**Created:** [October 8, 2012, 10:12am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580 "2012-10-08T10:12:13Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [August 12, 2014, 2:39am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/21 "2014-08-12T02:39:52Z")

</div>

> BootRST must be set to 1.

That seems odd. Exactly what are your (working) fuses set to, now?

---

<div class="post-metadata">

**Author:** ![NicoHood](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/nicohood/32/217297_2.png) [@NicoHood](https://forum.arduino.cc/u/NicoHood)\
**Post date:** [August 12, 2014, 9:36am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/22 "2014-08-12T09:36:59Z")

</div>

Add this to your boards.txt and burn the bootloader once. The bootloader is not used, its just to change the fuse. Then you can upload via isp and the sketch will load

```cpp
## Arduino Mega w/ ATmega2560 Testato Mega ISP Version
## -------------------------
mega.menu.cpu.atmega2560T=ATmega2560 (Testato ISP Version)

mega.menu.cpu.atmega2560T.upload.protocol=wiring
mega.menu.cpu.atmega2560T.upload.maximum_size=258048
mega.menu.cpu.atmega2560T.upload.speed=115200

mega.menu.cpu.atmega2560T.bootloader.high_fuses=0xD9
mega.menu.cpu.atmega2560T.bootloader.extended_fuses=0xFD
mega.menu.cpu.atmega2560T.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex

mega.menu.cpu.atmega2560T.build.mcu=atmega2560
mega.menu.cpu.atmega2560T.build.board=AVR_MEGA2560

```

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [August 12, 2014, 10:15am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/23 "2014-08-12T10:15:26Z")

</div>

It was uploading sketches via ISP that wasn't working?  
It's possible that that doesn't work on 2560, but does work on 328, because the program counter wrap-around happens differently on a chip with more than 64kwords of flash. On a 328, if you start in the "bootloader section" at 0x3F00 (where there isn't any actual code), it will execute relatively useless but unharmful instructions till it gets to 0x3FFF, and then wrap around to location 0x0, where your sketch actually begins. On a 2560, if the bootloader section starts at 0x1F000 and muddles along to 0x1FFFF, I'm not sure whether it will wrap to 0x0 (your sketch), or to 0x10000 (middle of nowhere, where it will eventually wrap again.)

I can't find this clarified in the documentation. Not that you need a "long" jump/call or to use EIND to change the high bit during normal program execution.

---

<div class="post-metadata">

**Author:** ![testato](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@testato](https://forum.arduino.cc/u/testato)\
**Post date:** [August 12, 2014, 12:25pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/24 "2014-08-12T12:25:52Z")

</div>

> westfw:  
> I'm not sure whether it will wrap to 0x0 (your sketch), or to 0x10000 (middle of nowhere, where it will eventually wrap again.)

Hi westfw,  
on the 2560 at the end of the flash the PC do not jump to 0x0, I discover this behavior some months ago and found that we need modifie the fuses.  
NOrmally in the arduino board the high\_fuses=0xD8, we need it change to D9 (the submenu' code posted here is mine ;))

---

<div class="post-metadata">

**Author:** ![testato](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@testato](https://forum.arduino.cc/u/testato)\
**Post date:** [August 12, 2014, 12:36pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/25 "2014-08-12T12:36:18Z")

</div>

but Arduino team do not know this ? when it create the "Upload via Programmer" tab/option i test it (i write a guide on it in my sign) and discover that this command do not work on Mega.  
I do not know if we must manage this behaviour like a Bug, (bug on Mega, or bug on Uno, depend what the team means whit Upload via Programmer)  
I think the team wants to exploit the behavior of the ProgramCounter on the UNO, so the team do not want that the user must change the Fuses, but did not realize that this trick work only on the 328 🙂  
What do you think ?

---

<div class="post-metadata">

**Author:** ![SkobyMobil](https://avatars.discourse-cdn.com/v4/letter/s/85f322/32.png) [@SkobyMobil](https://forum.arduino.cc/u/SkobyMobil)\
**Post date:** [August 12, 2014, 2:19pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/26 "2014-08-12T14:19:42Z")

</div>

Hi there,  
yes! A Bug's it!  
I can use an Arduino Mega 2560 a 328P flashen- without problems.  
I can not flash with an Arduino Mega 2560 a Mega 2560.  
This only works with foreign hardware or complicated changing the software.  
But no one understands. What is this?  
Greeting and fun  
Andreas

P.S. I try to just:  
Arduino Maga 2560 -\> Mega 2560  
[http://www.ebay.de/itm/Mikrocontroller-Atmel-ATMega2560-ATMega-SMD-Adapter-/271224130246?pt=Bauteile&hash=item3f2637cac6](http://www.ebay.de/itm/Mikrocontroller-Atmel-ATMega2560-ATMega-SMD-Adapter-/271224130246?pt=Bauteile&hash=item3f2637cac6)

---

<div class="post-metadata">

**Author:** ![westfw](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/westfw/32/213443_2.png) [@westfw](https://forum.arduino.cc/u/westfw)\
**Post date:** [August 13, 2014, 1:34am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/27 "2014-08-13T01:34:43Z")

</div>

It is equally a bug that the "bootrst" fuse is left programmed (0) on a m328 when you do "upload using programmer." It only works if the sketch is short enough not to overlap where the bootloader WOULD be...

This was apparently reported a long time ago, but never understood well enough to fix. I've added a comment to the bug.

> <https://github.com/arduino/ArduinoCore-avr/issues/246>
>
> EDIT: \*\*The original issue from google code has been solved. This issue is still… open to keep track of uploading problems using USBAsp programmer, see comments below for details.\*\*
> 
> This is \[Issue 388\](http://code.google.com/p/arduino/issues/detail?id=388) moved from a Google Code project.
> Added by 2010-10-28T20:36:23.000Z by \[rdlsoftware@gmail.com\](http://code.google.com/u/rdlsoftware@gmail.com/).
> Please review that bug for more context and additional comments, but update this bug.
> \### Original description
> 
> \*\*What steps will reproduce the problem?\*\*
> 1. Wire up a connection between the Arduino Duemilanove and Mega 2560
> 2. Upload ArduinoISP (from IDE 021) to Arduino Duemilanove
> 3. Upload a new bootloader to a Mega 2560 via the 'programmer'
> 
> \*\*What is the expected output? What do you see instead?\*\*
> After uploading, the mega should accept new sketches.
> 
> \*\*What version of the Arduino software are you using? On what operating\*\*
> \*\*system? Which Arduino board are you using?\*\*
> 
> Arduino 021. Arduino Duemilanove as ArduinoISP (version from IDE 021), Arduino Mega 2560 as target hardware. Windows 7 64 bit.
> 
> \*\*Please provide any additional information below.\*\*
> See http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287952386 for original post of issue.

---

<div class="post-metadata">

**Author:** ![testato](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@testato](https://forum.arduino.cc/u/testato)\
**Post date:** [August 13, 2014, 3:27pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/28 "2014-08-13T15:27:04Z")

</div>

the lenght is not a problem, because in the board.txt you have the maximum sketch value, so if you do not change the original boards.txt you do not have problem.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 4, 2014, 2:35pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/29 "2014-11-04T14:35:54Z")

</div>

I have the same problem:

1. when trying to bootload a custom Atmega2560 pcb with arduinoMega as ISP i receive: content mismatch at 0x1e000...

2. i tried uploading blink sketch and no results even after the terminal says uploaded.

I dont know how to change the bootRST to 1 and the change required for boards.txt file. Can someone please clarify this.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [November 4, 2014, 3:49pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/30 "2014-11-04T15:49:53Z")

</div>

> NicoHood:  
> we fixed the problem. fuse BootRST must be set to 1. to execute the program. Somehow its not needed for an uno.  
> stay tuned on further hoodloader releases 😉

How do i change the bootRST to 1?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [March 4, 2015, 9:28pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/31 "2015-03-04T21:28:38Z")

</div>

Thank you so much Testato!!! I was banging my head against the wall for days trying to figure this out.

---

<div class="post-metadata">

**Author:** ![wanek](https://avatars.discourse-cdn.com/v4/letter/w/ee59a6/32.png) [@wanek](https://forum.arduino.cc/u/wanek)\
**Post date:** [May 28, 2018, 2:37pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/32 "2018-05-28T14:37:26Z")

</div>

guys, thanks a lot for this solution! i have lost several days with this issue, until i've found this topic!

best regards,

---

<div class="post-metadata">

**Author:** ![testato](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@testato](https://forum.arduino.cc/u/testato)\
**Post date:** [May 29, 2018, 9:10am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/33 "2018-05-29T09:10:22Z")

</div>

The issue related to this bug have about 10 years 🙂  
It was opened on googlecode and imported to github

> <https://github.com/arduino/ArduinoCore-avr/issues/246>
>
> EDIT: \*\*The original issue from google code has been solved. This issue is still… open to keep track of uploading problems using USBAsp programmer, see comments below for details.\*\*
> 
> This is \[Issue 388\](http://code.google.com/p/arduino/issues/detail?id=388) moved from a Google Code project.
> Added by 2010-10-28T20:36:23.000Z by \[rdlsoftware@gmail.com\](http://code.google.com/u/rdlsoftware@gmail.com/).
> Please review that bug for more context and additional comments, but update this bug.
> \### Original description
> 
> \*\*What steps will reproduce the problem?\*\*
> 1. Wire up a connection between the Arduino Duemilanove and Mega 2560
> 2. Upload ArduinoISP (from IDE 021) to Arduino Duemilanove
> 3. Upload a new bootloader to a Mega 2560 via the 'programmer'
> 
> \*\*What is the expected output? What do you see instead?\*\*
> After uploading, the mega should accept new sketches.
> 
> \*\*What version of the Arduino software are you using? On what operating\*\*
> \*\*system? Which Arduino board are you using?\*\*
> 
> Arduino 021. Arduino Duemilanove as ArduinoISP (version from IDE 021), Arduino Mega 2560 as target hardware. Windows 7 64 bit.
> 
> \*\*Please provide any additional information below.\*\*
> See http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287952386 for original post of issue.

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [May 29, 2018, 9:32am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/34 "2018-05-29T09:32:50Z")

</div>

...but the problem was solved almost two years ago by the update to AVRDUDE 6.3.0.

---

<div class="post-metadata">

**Author:** ![testato](https://avatars.discourse-cdn.com/v4/letter/t/e99b99/32.png) [@testato](https://forum.arduino.cc/u/testato)\
**Post date:** [May 29, 2018, 9:40am UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/35 "2018-05-29T09:40:50Z")

</div>

Maybe @wanek You used USBasp with firmware versions other than PeterVH's 1.05 or PeterVH/bperrybap's 1.06-alpha ?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 4:47pm UTC](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580/36 "2021-05-06T16:47:02Z")

</div>



[Previous page](https://forum.arduino.cc/t/arduino-mega2560-as-isp-to-program-another-arduino-mega2560/123580.md?page=1)
