Burning bootloader on atmega2560

Hi, how do I burn a bootloader onto the Atmega2560? Are there the Same Pins used as shown on the breadboard Version for the atmega328 on this Site? Mosi/Miso/SSK and the Reset pin?

20/21/22 and 30 (Reset) on the 2560?

Can I do this with the arduino ISP using an atmega328?

Can I do this with the arduino ISP using an atmega328?

yes you can.

However I've found that Nick Gammon's program is much simpler (and also runs on any arduino board) to use and gives you more information (via the IDE's serial monitor) at it interrogates the chips, and waits for you to tell it to proceed. He also shows the wiring setup for both standard boards and standalone setups.

Lefty

Oh, Thanks! That is what I was looking for! Now I only need to put an ICSP connector on my Board

Hi,

I tried to use the script. But something went wrong...

Atmega chip programmer.
Written by Nick Gammon.
Entered programming mode OK.
Signature = 0x1E 0x98 0x01 
Processor = ATmega2560
Flash memory size = 262144 bytes.
LFuse = 0x01 
HFuse = 0x99 
EFuse = 0x00 
Lock byte = 0xFF 
Clock calibration = 0x00 
Bootloader address = 0x3E000
Bootloader length = 7434 bytes.
Type 'V' to verify, or 'G' to program the chip with the bootloader ...
Erasing chip ...
Writing bootloader ...
Committing page starting at 0x3E000
Committing page starting at 0x3E100
Committing page starting at 0x3E200
Committing page starting at 0x3E300
Committing page starting at 0x3E400
Committing page starting at 0x3E500
Committing page starting at 0x3E600
Committing page starting at 0x3E700
Committing page starting at 0x3E800
Committing page starting at 0x3E900
Committing page starting at 0x3EA00
Committing page starting at 0x3EB00
Committing page starting at 0x3EC00
Committing page starting at 0x3ED00
Committing page starting at 0x3EE00
Committing page starting at 0x3EF00
Committing page starting at 0x3F000
Committing page starting at 0x3F100
Committing page starting at 0x3F200
Committing page starting at 0x3F300
Committing page starting at 0x3F400
Committing page starting at 0x3F500
Committing page starting at 0x3F600
Committing page starting at 0x3F700
Committing page starting at 0x3F800
Committing page starting at 0x3F900
Committing page starting at 0x3FA00
Committing page starting at 0x3FB00
Committing page starting at 0x3FC00
Committing page starting at 0x3FD00
Written.
Verifying ...
Verification error at address 3E000. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E001. Got: 0xFF  Expected: 0x94 
Verification error at address 3E002. Got: 0xFF  Expected: 0x89 
Verification error at address 3E003. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E004. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E005. Got: 0xFF  Expected: 0x94 
Verification error at address 3E006. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E007. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E008. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E009. Got: 0xFF  Expected: 0x94 
Verification error at address 3E00A. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E00B. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E00C. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E00D. Got: 0xFF  Expected: 0x94 
Verification error at address 3E00E. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E00F. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E010. Got: 0xFE  Expected: 0x0D 
Verification error at address 3E011. Got: 0xFF  Expected: 0x94 
Verification error at address 3E012. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E013. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E014. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E015. Got: 0x02  Expected: 0x94 
Verification error at address 3E016. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E017. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E018. Got: 0x0C  Expected: 0x0D 
Verification error at address 3E019. Got: 0xFF  Expected: 0x94 
Verification error at address 3E01A. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E01B. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E01C. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E01D. Got: 0x0E  Expected: 0x94 
Verification error at address 3E01E. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E01F. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E020. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E021. Got: 0xFF  Expected: 0x94 
Verification error at address 3E022. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E023. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E024. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E025. Got: 0x12  Expected: 0x94 
Verification error at address 3E026. Got: 0x13  Expected: 0xB2 
Verification error at address 3E027. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E028. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E029. Got: 0xFF  Expected: 0x94 
Verification error at address 3E02A. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E02B. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E02C. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E02D. Got: 0xFF  Expected: 0x94 
Verification error at address 3E02E. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E02F. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E030. Got: 0xFE  Expected: 0x0D 
Verification error at address 3E031. Got: 0xFF  Expected: 0x94 
Verification error at address 3E032. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E033. Got: 0x19  Expected: 0xF1 
Verification error at address 3E034. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E035. Got: 0xFF  Expected: 0x94 
Verification error at address 3E036. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E037. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E038. Got: 0xFE  Expected: 0x0D 
Verification error at address 3E039. Got: 0xFF  Expected: 0x94 
Verification error at address 3E03A. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E03B. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E03C. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E03D. Got: 0xFF  Expected: 0x94 
Verification error at address 3E03E. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E03F. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E040. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E041. Got: 0x20  Expected: 0x94 
Verification error at address 3E042. Got: 0x21  Expected: 0xB2 
Verification error at address 3E043. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E044. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E045. Got: 0xFF  Expected: 0x94 
Verification error at address 3E046. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E047. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E048. Got: 0x24  Expected: 0x0D 
Verification error at address 3E049. Got: 0xFF  Expected: 0x94 
Verification error at address 3E04A. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E04B. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E04C. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E04D. Got: 0x2E  Expected: 0x94 
Verification error at address 3E04E. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E04F. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E050. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E051. Got: 0x28  Expected: 0x94 
Verification error at address 3E052. Got: 0x29  Expected: 0xB2 
Verification error at address 3E053. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E054. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E055. Got: 0x22  Expected: 0x94 
Verification error at address 3E056. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E057. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E058. Got: 0xFE  Expected: 0x0D 
Verification error at address 3E059. Got: 0xFF  Expected: 0x94 
Verification error at address 3E05A. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E05B. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E05C. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E05D. Got: 0x2E  Expected: 0x94 
Verification error at address 3E05E. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E05F. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E060. Got: 0xFF  Expected: 0x0D 
Verification error at address 3E061. Got: 0xFE  Expected: 0x94 
Verification error at address 3E062. Got: 0xFF  Expected: 0xB2 
Verification error at address 3E063. Got: 0xFF  Expected: 0xF1 
Verification error at address 3E064. Got: 0xFF  Expected: 0x0D 
7218 verification error(s).
First 100 shown.
Type 'C' when ready to continue with another chip ...

The number on Verification error(s) oscillates between 7128 and 3100
Suggestions? :slight_smile:

EDIT: Got it working by changing

  // slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV64);

to

  // slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV128);

I have a shinny new atmega2560 which appears to have a couple of issues.

First you have to power cycle the board, reset won't do, to avoid an initial programmer timeout when uploading the board with the IDE (1.0.3). The sketch loads and runs with or without the timeout. I just get an initial delay and then the sketch uploads. I should note that this doesn't happen with windows just osx.

The error is "avrdude: stk500v2_ReceiveMessage(): timeout"

Second is the "!!!" issue which locks up the board.

From the reading I've done all I have to do is follow Nicks instructions and use an UNO to program a new bootloader in the atmega2560.

Am I close?

tsaG:
Hi,

I tried to use the script. But something went wrong...

Atmega chip programmer.

Written by Nick Gammon.
Entered programming mode OK.
Signature = 0x1E 0x98 0x01
Processor = ATmega2560
Flash memory size = 262144 bytes.
LFuse = 0x01
HFuse = 0x99
EFuse = 0x00
Lock byte = 0xFF
Clock calibration = 0x00
Bootloader address = 0x3E000
Bootloader length = 7434 bytes.
Type 'V' to verify, or 'G' to program the chip with the bootloader ...
Erasing chip ...
Writing bootloader ...
Committing page starting at 0x3E000
Committing page starting at 0x3E100
Committing page starting at 0x3E200
Committing page starting at 0x3E300
Committing page starting at 0x3E400
Committing page starting at 0x3E500
Committing page starting at 0x3E600
Committing page starting at 0x3E700
Committing page starting at 0x3E800
Committing page starting at 0x3E900
Committing page starting at 0x3EA00
Committing page starting at 0x3EB00
Committing page starting at 0x3EC00
Committing page starting at 0x3ED00
Committing page starting at 0x3EE00
Committing page starting at 0x3EF00
Committing page starting at 0x3F000
Committing page starting at 0x3F100
Committing page starting at 0x3F200
Committing page starting at 0x3F300
Committing page starting at 0x3F400
Committing page starting at 0x3F500
Committing page starting at 0x3F600
Committing page starting at 0x3F700
Committing page starting at 0x3F800
Committing page starting at 0x3F900
Committing page starting at 0x3FA00
Committing page starting at 0x3FB00
Committing page starting at 0x3FC00
Committing page starting at 0x3FD00
Written.
Verifying ...
Verification error at address 3E000. Got: 0xFF  Expected: 0x0D
Verification error at address 3E001. Got: 0xFF  Expected: 0x94
Verification error at address 3E002. Got: 0xFF  Expected: 0x89
Verification error at address 3E003. Got: 0xFF  Expected: 0xF1
Verification error at address 3E004. Got: 0xFF  Expected: 0x0D
Verification error at address 3E005. Got: 0xFF  Expected: 0x94
Verification error at address 3E006. Got: 0xFF  Expected: 0xB2
Verification error at address 3E007. Got: 0xFF  Expected: 0xF1
Verification error at address 3E008. Got: 0xFF  Expected: 0x0D
Verification error at address 3E009. Got: 0xFF  Expected: 0x94
Verification error at address 3E00A. Got: 0xFF  Expected: 0xB2
Verification error at address 3E00B. Got: 0xFF  Expected: 0xF1
Verification error at address 3E00C. Got: 0xFF  Expected: 0x0D
Verification error at address 3E00D. Got: 0xFF  Expected: 0x94
Verification error at address 3E00E. Got: 0xFF  Expected: 0xB2
Verification error at address 3E00F. Got: 0xFF  Expected: 0xF1
Verification error at address 3E010. Got: 0xFE  Expected: 0x0D
Verification error at address 3E011. Got: 0xFF  Expected: 0x94
Verification error at address 3E012. Got: 0xFF  Expected: 0xB2
Verification error at address 3E013. Got: 0xFF  Expected: 0xF1
Verification error at address 3E014. Got: 0xFF  Expected: 0x0D
Verification error at address 3E015. Got: 0x02  Expected: 0x94
Verification error at address 3E016. Got: 0xFF  Expected: 0xB2
Verification error at address 3E017. Got: 0xFF  Expected: 0xF1
Verification error at address 3E018. Got: 0x0C  Expected: 0x0D
Verification error at address 3E019. Got: 0xFF  Expected: 0x94
Verification error at address 3E01A. Got: 0xFF  Expected: 0xB2
Verification error at address 3E01B. Got: 0xFF  Expected: 0xF1
Verification error at address 3E01C. Got: 0xFF  Expected: 0x0D
Verification error at address 3E01D. Got: 0x0E  Expected: 0x94
Verification error at address 3E01E. Got: 0xFF  Expected: 0xB2
Verification error at address 3E01F. Got: 0xFF  Expected: 0xF1
Verification error at address 3E020. Got: 0xFF  Expected: 0x0D
Verification error at address 3E021. Got: 0xFF  Expected: 0x94
Verification error at address 3E022. Got: 0xFF  Expected: 0xB2
Verification error at address 3E023. Got: 0xFF  Expected: 0xF1
Verification error at address 3E024. Got: 0xFF  Expected: 0x0D
Verification error at address 3E025. Got: 0x12  Expected: 0x94
Verification error at address 3E026. Got: 0x13  Expected: 0xB2
Verification error at address 3E027. Got: 0xFF  Expected: 0xF1
Verification error at address 3E028. Got: 0xFF  Expected: 0x0D
Verification error at address 3E029. Got: 0xFF  Expected: 0x94
Verification error at address 3E02A. Got: 0xFF  Expected: 0xB2
Verification error at address 3E02B. Got: 0xFF  Expected: 0xF1
Verification error at address 3E02C. Got: 0xFF  Expected: 0x0D
Verification error at address 3E02D. Got: 0xFF  Expected: 0x94
Verification error at address 3E02E. Got: 0xFF  Expected: 0xB2
Verification error at address 3E02F. Got: 0xFF  Expected: 0xF1
Verification error at address 3E030. Got: 0xFE  Expected: 0x0D
Verification error at address 3E031. Got: 0xFF  Expected: 0x94
Verification error at address 3E032. Got: 0xFF  Expected: 0xB2
Verification error at address 3E033. Got: 0x19  Expected: 0xF1
Verification error at address 3E034. Got: 0xFF  Expected: 0x0D
Verification error at address 3E035. Got: 0xFF  Expected: 0x94
Verification error at address 3E036. Got: 0xFF  Expected: 0xB2
Verification error at address 3E037. Got: 0xFF  Expected: 0xF1
Verification error at address 3E038. Got: 0xFE  Expected: 0x0D
Verification error at address 3E039. Got: 0xFF  Expected: 0x94
Verification error at address 3E03A. Got: 0xFF  Expected: 0xB2
Verification error at address 3E03B. Got: 0xFF  Expected: 0xF1
Verification error at address 3E03C. Got: 0xFF  Expected: 0x0D
Verification error at address 3E03D. Got: 0xFF  Expected: 0x94
Verification error at address 3E03E. Got: 0xFF  Expected: 0xB2
Verification error at address 3E03F. Got: 0xFF  Expected: 0xF1
Verification error at address 3E040. Got: 0xFF  Expected: 0x0D
Verification error at address 3E041. Got: 0x20  Expected: 0x94
Verification error at address 3E042. Got: 0x21  Expected: 0xB2
Verification error at address 3E043. Got: 0xFF  Expected: 0xF1
Verification error at address 3E044. Got: 0xFF  Expected: 0x0D
Verification error at address 3E045. Got: 0xFF  Expected: 0x94
Verification error at address 3E046. Got: 0xFF  Expected: 0xB2
Verification error at address 3E047. Got: 0xFF  Expected: 0xF1
Verification error at address 3E048. Got: 0x24  Expected: 0x0D
Verification error at address 3E049. Got: 0xFF  Expected: 0x94
Verification error at address 3E04A. Got: 0xFF  Expected: 0xB2
Verification error at address 3E04B. Got: 0xFF  Expected: 0xF1
Verification error at address 3E04C. Got: 0xFF  Expected: 0x0D
Verification error at address 3E04D. Got: 0x2E  Expected: 0x94
Verification error at address 3E04E. Got: 0xFF  Expected: 0xB2
Verification error at address 3E04F. Got: 0xFF  Expected: 0xF1
Verification error at address 3E050. Got: 0xFF  Expected: 0x0D
Verification error at address 3E051. Got: 0x28  Expected: 0x94
Verification error at address 3E052. Got: 0x29  Expected: 0xB2
Verification error at address 3E053. Got: 0xFF  Expected: 0xF1
Verification error at address 3E054. Got: 0xFF  Expected: 0x0D
Verification error at address 3E055. Got: 0x22  Expected: 0x94
Verification error at address 3E056. Got: 0xFF  Expected: 0xB2
Verification error at address 3E057. Got: 0xFF  Expected: 0xF1
Verification error at address 3E058. Got: 0xFE  Expected: 0x0D
Verification error at address 3E059. Got: 0xFF  Expected: 0x94
Verification error at address 3E05A. Got: 0xFF  Expected: 0xB2
Verification error at address 3E05B. Got: 0xFF  Expected: 0xF1
Verification error at address 3E05C. Got: 0xFF  Expected: 0x0D
Verification error at address 3E05D. Got: 0x2E  Expected: 0x94
Verification error at address 3E05E. Got: 0xFF  Expected: 0xB2
Verification error at address 3E05F. Got: 0xFF  Expected: 0xF1
Verification error at address 3E060. Got: 0xFF  Expected: 0x0D
Verification error at address 3E061. Got: 0xFE  Expected: 0x94
Verification error at address 3E062. Got: 0xFF  Expected: 0xB2
Verification error at address 3E063. Got: 0xFF  Expected: 0xF1
Verification error at address 3E064. Got: 0xFF  Expected: 0x0D
7218 verification error(s).
First 100 shown.
Type 'C' when ready to continue with another chip ...



The number on Verification error(s) oscillates between 7128 and 3100
Suggestions? :)


EDIT: Got it working by changing 


// slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV64);




to 



// slow down SPI for benefit of slower processors like the Attiny
  SPI.setClockDivider (SPI_CLOCK_DIV128);

Just wanted to report this saved my life and I want to have your babies. If you are working with Nick Gammons (amazing!) uploader script and Mega2560's apply this fix. Nick, maybe have it change only on detect of a Tiny? Also is there somewhere we can donate money to your cause?