Go Down

Topic: Trouble Burning a Bootloader to Arduino (Read 1 time) previous topic - next topic

pingiscoolest

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: [Select]
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: [Select]
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

johnwasser

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".
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

pingiscoolest

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.

retrolefty


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

fungus


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)
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

fungus


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.

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

retrolefty



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

pingiscoolest

#7
Mar 13, 2013, 05:47 pm Last Edit: Mar 13, 2013, 05:59 pm by pingiscoolest Reason: 1
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: [Select]
#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

fungus


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...

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

pingiscoolest

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: [Select]
#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

tim7


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.

Go Up