Pages: [1]   Go Down
Author Topic: Arduino Mega2560 as ISP to program another Arduino Mega2560  (Read 3535 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
Rock&Roll;
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm trying to use an Arduino Mega2560 as ISP to program another Arduino Mega2560.

After reading a lot of info about, I tried several different ways to connect the arduinos but it didn't work. So, I tell you my attempts in case you can help me. Even I tried to use an Arduino Uno to work as ISP or to upload the code to it, but it didn't work either.

First of all, I upload to one of them (Arduino Mega2560) the ArduinoISP example, and select programmer 'Arduino as ISP'. Select the right board to upload the code and the port.

1- I connect as in the Arduino ISP example (http://arduino.cc/es/Tutorial/ArduinoISP) but optimized for the Mega.
MISO (50)  -  MISO   (50)
MOSI (51)  -  MOSI   (51)
SCK   (52)  -  SCK     (52)
SS      (53)  -  Reset  (30)

2- I tried to connect the wires in the opposite way.
MISO (50)  -  MOSI   (51)
MOSI (51)  -  MISO   (50)
SCK   (52)  -  SCK     (52)
SS      (53)  -  Reset  (30)

3- Also with Arduino Uno, I changed to fix the wires to Arduino Uno pin configuration.
MISO (50)  -  MISO   (12)
MOSI (51)  -  MOSI   (11)
SCK   (52)  -  SCK     (13)
SS      (53)  -  Reset  (7)

4- And the other way, Arduino Uno as ISP.
MISO (12)  -  MISO   (50)
MOSI (11)  -  MOSI   (51)
SCK   (13)  -  SCK     (52)
SS      (7)  -  Reset  (30)

I can't do anything. I read about plug a 10 uF capacitor between 'reset' and 'gnd' after upload Arduino ISP, but this didn't work either.

Could any help me?? It's important to solve this problem.

* I'm working under Ubuntu environment, with Arduino IDE 1.0.

Thanks!
Logged

Greenville, IL
Offline Offline
Edison Member
*
Karma: 15
Posts: 1328
Warning Novice on board! 0 to 1 chance of errors!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is Nick Gammon's  bootloader page, it is written for Uno but, it may work for Mega. Note that the SS pin on the Uno is (10). You may have to change the pin to 52 or use 10 on the Mega instead. It does not require a capacitor across reset.       Link is below.


 Use this wire scheme:
Programmer    Target
MISO (50)  -     MISO   (50)
MOSI (51)  -     MOSI   (51)
SCK  (52)  -     SCK     (52)
SS    (53)  -     Reset  (30)
5V           -      5V
GND         -     GND

Then use the program from this page:
http://www.gammon.com.au/forum/?id=11635
Logged


Portland, OR
Offline Offline
Sr. Member
****
Karma: 7
Posts: 260
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Couple more things:
1) What exactly do you mean by "It didn't work"? Be specific about what exactly you saw on the bottom terminal of the Arduino IDE window and on the LEDs of the ISP-side board.

2) Look at the page linked by cyclegadget but also this tutorial:
http://www.instructables.com/id/How-to-use-Arduino-Mega-2560-as-Arduino-isp/

3) You can use either the Mega board or the Uno board as your ISP board. Both should work equally effectively, as long as you make sure to first do a standard sketch upload of the "ArduinoISP" sketch to your chosen ISP board.

4) A note: Remember, SS from the ISP board -> Reset pin of the TARGET board always. If you look at the tutorials, you'll understand why the target's reset pin is used.

5) For your target, are you trying to program the chip on an Arduino Mega board or just onto your self-made/barebones Atmega2560 circuit?

6) If you are using an Arduino Mega board as the target, be sure to connect to the pin labeled "RESET" on the board.
« Last Edit: October 08, 2012, 11:40:13 am by giantsfan3 » Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
Rock&Roll;
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, first of all, thanks!!

I'll try to be more explicit.

1) I mean that when I try to upload the code, I follow next steps:
  - Check Port.
  - Check target board (Arduino Mega2560).
  - Check programmer (Arduino as ISP).
  - With an Arduino Mega2560 and the ArduinoISP code uploaded, I program the target board. I see how Tx & Rx leds of programmer board blink, but in the target board I don't see anything.
  - In the bottom terminal of the IDE it is all right, so I understand the proccess worked fine.

2) Maybe I have done a mistake with Reset pin, I connect the SS pin (53) to the 'Reset' labeled one in the target board (I thinked is pin 30 in microcontroller).

3) At the moment, I'm only trying to use an Arduino Mega2560 as ISP to program another Arduino Mega2560 board.

I'm going to continue working on this issue, but if you could help it woul be great!

Thanks again!
Logged

Pages: [1]   Go Up
Jump to: