Pages: [1]   Go Down
Author Topic: Trouble Burning a Bootloader to Arduino  (Read 1089 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am working on a 3D printer, and have an arduino based extruder controller (Info page here http://reprap.org/wiki/Extruder_Controller_2.2#Burn_the_Bootloader)that I am trying to burn a bootloader to with my USBTinyISP (http://www.ladyada.net/make/usbtinyisp/). Unfortunately, when I try to do this from the Arduino IDE, I get the error
Code:
initialization failed, rc=-1 Double check connections and try again, or use -F to override this check.
. I believe that this indicates that the Arduino IDE is able to communicate with the ISP, but not with the chip I am trying to burn the bootloader to. I checked the cables from the ISP to the Arduino clone, and they were correct. I built both the extruder controller and the ISP from kits, so there is a possiblility I made a mistake. To try to see if my ISP was working I trued to burn a bootloader to my official Arduino Duemilanove, which of course already had a bootloader, and I got the same error message. Since I couldn't burn a bootloader to a known working arduino, I thought that the issue must be my ISP, so I followed the tutorial on the Arduino site for using the Arduino as an ISP, but I got the error
Code:
Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

I've tried everything I can think of. Does anybody have any ideas on what to try next? I'm willing to try anything at this point. Thanks in advance for all suggestions
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8940
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The 6-pin ICSP header isn't keyed so it is possible to plug the cable in backward.  That is one thing you can check.  The cable typically has a stripe on one side indicating Pin 1.  You should make sure that is on the Pin 1 side both at your USBtinyISP and at your "Arduino".
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've checked this, but the first time I tried it I had it connected backwards, so its been tried both ways. Is it possible that would damage anything? I don't think so since none of the pins should be over 5v.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've checked this, but the first time I tried it I had it connected backwards, so its been tried both ways. Is it possible that would damage anything? I don't think so since none of the pins should be over 5v.

I've hooked up the 6 pin connector backwards and while it of course didn't work, it didn't cause any damage. You will know it's on correctly if the target board's power-on led lights up.

Lefty
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5636
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've checked this, but the first time I tried it I had it connected backwards, so its been tried both ways. Is it possible that would damage anything?

Yes.

I don't think so since none of the pins should be over 5v.

Try connecting a LED to the 5V supply backwards. See if it damages it... (make sure it's a LED you didn't care about)

Or an electrolytic capacitor (make sure you wear safety goggles and ear plugs)
Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5636
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've hooked up the 6 pin connector backwards and while it of course didn't work, it didn't cause any damage. You will know it's on correctly if the target board's power-on led lights up.

The Mega328's pins seem to be arranged so that backwards connections won't hurt it.

There's a lot of other stuff on his PCB though. Not all of it might be so thoughtfully designed.

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17301
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've hooked up the 6 pin connector backwards and while it of course didn't work, it didn't cause any damage. You will know it's on correctly if the target board's power-on led lights up.

The Mega328's pins seem to be arranged so that backwards connections won't hurt it.

There's a lot of other stuff on his PCB though. Not all of it might be so thoughtfully designed.



Yea, it's not something one should do on purpose. Just reporting I've done it more then once and there appeared to be no lasting damage resulting from it. If the power on led on the 'target' board is on then you have it on correctly, assuming the 'programmer' board is powering the 'target' board.

Lefty
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To be clear, I have only connected the 6 pin cable backwards on my arduino Duemilanove, not the clone as it is keyed. I understand that reverse current can fry many devices even at low voltages (all too well unfortunately) but I was under the impression that during programming by an ISP, all the pins except the 5V power and Ground will switch between 5v and 0v at some point. Does this not mean that the circuit must be designed to handle both 5v and 0v? I guess its possible that the Arduino could be destroyed by reverse current to its 5v and Gnd pins, but mine will still accept and run sketches so I don't think that is the issue.

Anyway, I checked pins 10-13 on my arduino (the ones used when using the arduino as ISP) and pin 10 isn't working properly. This pin is connected to the reset pin on the board being written to, so that might be my issue. Since I have tried my USBTinyISP on 3 different boards now - 1 of them known working - and haven't been able to write a bootloader or use it to program a sketch, I think it may not be working. I will order a prebuilt one and see if that works unless somebody has another suggestion to try. Perhaps it is possible to change the Arduino as ISP sketch to use a different pin as the reset pin? It doesn't look like pin 10 is of any particular significance, and looking at the sketch I see the line
Code:
#include "pins_arduino.h"
#define RESET     SS
In pins_arduino.h, SS is defined as pin 10. Does this mean if I change SS in pins_arduino.h to pin 2, I could use that instead?

Thanks
« Last Edit: March 13, 2013, 11:59:46 am by pingiscoolest » Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 150
Posts: 5636
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In pins_arduino.h, SS is defined as pin 10. Does this mean if I change SS in pins_arduino.h to pin 2, I could use that instead?

It would take you about 10 seconds to find out...

Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote from: pingiscoolest on Today at 04:47:58 PM
In pins_arduino.h, SS is defined as pin 10. Does this mean if I change SS in pins_arduino.h to pin 2, I could use that instead?

It would take you about 10 seconds to find out...

You're right, let me rephrase that. I did try that, both by changing the the code to
Code:
#include "pins_arduino.h"
#define RESET     2

and by modifying the pins_arduino.h file, but I still got the same error message as before. I guess my question is actually should this have worked? If my only issue before was that pin 10 on my Arduino didn't work, should I this have worked?

Thanks again
Logged

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try connecting a LED to the 5V supply backwards. See if it damages it... (make sure it's a LED you didn't care about)
Most LEDs will easily withstand 5V reverse voltage with no ill effects.  In a multiplexed display reverse bias is unavoidable.
Logged

Pages: [1]   Go Up
Jump to: