Cannot install bootloader onto Mega2560 | SOLVED

Mr. Gammon,

I am having problem getting your boot loader to work. I am using two arduino mega's.

I currently have (where the mega with the sketch loaded is first:)

D10 to SS (53)
MOSI(51) to MOSI(51)
MISO(50) to MISO(50)
SCK(52) to SCK(52)
+5V to + 5V
Gnd to Gnd

Is it connected correctly?

The serial monitor output:

..............

This doesn't seem to be anything to do with a class to do a reset, so I split the topic.

Thank you, I responded there because it was where we were talking about the issue. I am still not able to get this to work correctly.

Qdeathstar:
Is it connected correctly?

No.

If you look at my page about that Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer you will see:

  D10         Reset

D10 on the programming board goes to Reset on the target board.

Thank you for your help, i have attempted to make the corrections but it is still not working. Here are some pictures.


On the programmer, D10 Connected.


From the programmer's D10, it goes to the targets Reset.


Programmer Mosi (51)


target MOSI (51)


programmer MISO(50) and SCK (52)


target MISO(50) and SCK (52)

I think one of the boards is bad, because i can get your sketch to load into one of them all of the time.. the other one times out most of the time and only some times will upload the sketch. It uploads the blink sketch all of the time though...

EDIT: I tried another Arduino and got this

Type 'C' when ready to continue with another chip ...
Attempting to enter programming mode .......
Entered programming mode OK.
Signature = 0x53 0x53 0x53
Unrecogized signature.
LFuse = 0x53
HFuse = 0x53
EFuse = 0x00
Lock byte = 0x00
Clock calibration = 0x00
Programming mode off.

So that seems to be progress but not exactly what i am looking for....

I'm thinking clock problems. Does the target board have decoupling capacitors? What frequency crystal does it have?

the Chrystal says 16.000 - 30 07 35

as far as the decoupling capacitor, I am not sure, but it is installed on a comparable board. This board will accept sketches from the ide.

Qdeathstar:
This board will accept sketches from the ide.

Really? Then how about installing the chip self-detector sketch: Gammon Forum : Electronics : Microprocessors : Sketch to detect Atmega chip types

On my Mega2560 I got this:

Signature detector.
Written by Nick Gammon.
Compiled on Mar 21 2015 at 14:07:23 with Arduino IDE 106.
Signature = 1E  98  01 
Fuses
Low = FF High = D8 Ext = FD Lock = EF 

Processor = ATmega2560
Flash memory size = 262144
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 8192 bytes starting at 3E000

Bootloader:

3E000: 0D 94 89 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E010: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E020: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E030: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E040: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E050: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 
3E060: 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 0D 94 B2 F1 

...  blah blah ...


MD5 sum of bootloader = 12 AA 80 07 4D 74 E3 DA BF 2D 25 84 6D 99 F7 20

I tried it on both mega's that I am using.

target mega

Signature detector.
Written by Nick Gammon.
Compiled on Mar 20 2015 at 23:21:33 with Arduino IDE 10600.
Signature = 1E  98  01 
Fuses
Low = FF High = D8 Ext = FD Lock = FF 

Processor = ATmega2560
Flash memory size = 262144
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 8192 bytes starting at 3E000

Bootloader:

...

MD5 sum of bootloader = 1E 35 14 08 1F 65 7F 8C 96 50 69 9F 19 1E 3D F0

programmer

programmer mega

[code]
Signature detector.
Written by Nick Gammon.
Compiled on Mar 20 2015 at 23:23:30 with Arduino IDE 10600.
Signature = 1E  98  01 
Fuses
Low = FF High = D8 Ext = FD Lock = FF 

Processor = ATmega2560
Flash memory size = 262144
Bootloader in use: Yes
EEPROM preserved through erase: No
Watchdog timer always on: No
Bootloader is 8192 bytes starting at 3E000

Bootloader:

....

MD5 sum of bootloader = 1E 35 14 08 1F 65 7F 8C 96 50 69 9F 19 1E 3D F0

One thing I did notice is that on the programmer mega, that clock says "R160JAC6s"

Well they both seem to have the bootloader on them, so what's the problem?

OK, so it looks like it was my wiring for the two boards that were known to be working. I used the ICSP headers instead of the digital pins for SPI and it loaded right up.

I have successfully updated the bootloader on those two.

However, the third board still won't update, and it looks like that one is bad?

I have it wired exactly the same way but the programmer board can't put it into programming mode...

I did the Self Read Signature, which it was able to load, and it returned the same output as the other two boards

I was going to get the output for you, but the sketch won't load onto that board now..... (timeout).

The problem is that the reset function the described in the topic that this topic was split from wasn't working on my mega. And, I was having this problem:

So, I was informed it might be an outdated bootloader

EDIT: Updating the bootloader solved both of those problems, and now my sketch runs as it should. Unless you have any other ideas on the third board, I guess that one is just bad and I should return it?

Thank you so much for your help and bootloader program!

Try the ICSP header on the dodgy board instead. That might help. Otherwise it looks like it is faulty.