Go Down

Topic: Arduino Nick Gammon's board programmer does not see Arduino Mega 2560 R2 and R3 (Read 1 time) previous topic - next topic

bluemetal

I have followed Nick Gammon's excellent tutorials on how to program Arduinos using ISP as seen here: http://www.gammon.com.au/forum/?id=11635

and it works well with any boards that I have (Duemilanove, Uno R2 and R3, BBB) except Arduino Mega R2 and R3.

I get the two top lines and nothing else:

Atmega chip programmer.
Written by Nick Gammon.


I have also tried the hex uploader sketch with the SD card as here: http://www.gammon.com.au/forum/?id=11638 with the exact same results.

The R2 maybe be fried (the original reason to try Nick Gammon's programmer) but the R3 is in perfect working order accepting sketches and running well, yet both produce the same results.

Has anyone tried to burn a bootloader onto the Mega's R2 or R3 and succeeded using the above mentioned methods or would know why the different behavior?

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bluemetal

That is the idea. He asked me to post the question here rather than at Github (by the sketches) as I originally done. He mentioned that he only has the R1 version of the Mega and that one worked with his method.

CrossRoads

Well, in all 3 cases, the programmer is controlling the SPI & Reset pins directly, I don't know why R1/R2/R3 would make a difference.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bluemetal

That is exactly why I find it so intriguing that it works with some boards and not others and that you are not really dealing with the board to a certain extent when using the cable (it still relies on the crystal and caps). It is acceptable with the R2 since it maybe fried beyond repair but the R3 is in perfect working order and being programmed on the same computer and software as Nick's sketches. I had a lot of problems with fuses, resonators and crystals with Sanguinololus some time ago, maybe there is something like that here too.

I tried turning the cable around, connecting directly according to his tutorial - it works with other boards but not my Megas - both original ones made in Italy bought from reputable sources.

I have also ordered a proper programmer (AVRISP STK500 V2.0 compatible with 2560's) and will try it out with that and see what happens then.

dhenry

Quote
except Arduino Mega R2 and R3.


If you are going with a proprietary design, you need to make sure that you have good support.

Or you go with a programmer with a large / active user base.


I get the two top lines and nothing else:

Atmega chip programmer.
Written by Nick Gammon.



Sorry for the delay, I missed the notification about this thread amongst all the spam.

That message says we haven't established programming contact with the board.

I suggest you try another one of my sketches, eg, the "detect signature" sketch:

http://www.gammon.com.au/forum/?id=11633

You can alter the clock rate in those sketches, here:

Code: [Select]

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


That is already pretty slow. I programmed a Mega at DIV4 which is much faster.

Maybe the ICSP header is not connected correctly. Try connecting the wires "directly" as per the info on my forum page.

Code: [Select]

Arduino Uno      Target Mega2560

D10 (SS)            Reset
D11 (MOSI)          D51
D12 (MISO)          D50
D13 (SCK)           D52

Gnd                 Gnd
+5V                 +5V
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics


Or you go with a programmer with a large / active user base.


The programmer has worked fine for me, thanks anyway for the suggestion dhenry.

Perhaps the Atmel one will work better, however I've found on the Atmel web site that technical reports simply get ignored.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics


I had a lot of problems with fuses, resonators and crystals with Sanguinololus some time ago, maybe there is something like that here too.


If you turned off the SPIEN fuse, then programming via ICSP is now disabled. The only way to fix that (if that is the case) is to use high-voltage programming.

Conceivably you turned off SPIEN but left a bootloader there, so you can continue to use the bootloader, but not replace it.

We can confirm that. If you can upload sketches (as you say you can) then upload this:

Code: [Select]

#include <avr/boot.h>

#define SIGRD 5

void setup ()
{
Serial.begin (115200);
Serial.println ();

Serial.print ("Signature = ");

byte sig;
  sig = boot_signature_byte_get (0);
  Serial.print (sig, HEX);
  Serial.print (" ");
  sig = boot_signature_byte_get (2);
  Serial.print (sig, HEX);
  Serial.print (" ");
  sig = boot_signature_byte_get (4);
  Serial.println (sig, HEX);

Serial.println ("Fuses");
byte fuse;
 
  Serial.print ("Low = ");
  fuse = boot_lock_fuse_bits_get (GET_LOW_FUSE_BITS);
  Serial.println (fuse, HEX);
  Serial.print ("High = ");
  fuse = boot_lock_fuse_bits_get (GET_HIGH_FUSE_BITS);
  Serial.println (fuse, HEX);
  Serial.print ("Ext = ");
  fuse = boot_lock_fuse_bits_get (GET_EXTENDED_FUSE_BITS);
  Serial.println (fuse, HEX);
  Serial.print ("Lock = ");
  fuse = boot_lock_fuse_bits_get (GET_LOCK_BITS);
  Serial.println (fuse, HEX);
}

void loop () {}


Please report what that returns. We can check your fuse settings from that.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

I got:

Code: [Select]

Signature = 1E 98 1
Fuses
Low = FF
High = D8
Ext = FD
Lock = EF
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up