Go Down

Topic: Unable to program Arduino due to bad programming (Read 850 times) previous topic - next topic

acecombat

I wasn't thinking clearly and accidently uploaded a program to activate all pins as outputs and turn them on so I could test connectivity on some of them.
Now I can't get my Arduino to accept an upload and I really need it ASAP.
Any ideas on how I can do this?
I tried holding the reset button whilst uploading but that didn't work :(

acecombat

Would burning the bootloader help?  I have a 2nd Arduino that I can use to try.
Both are Mega 2560's.  How does one wire those up to burn if that might help?

pYro_65

The reset button timing is very precise, have you tried a handful of times or just once. The ATMega's, I'm pretty sure, switch their ports to inputs on start up. Only after the bootloader has finished would your sketch set them as outputs.

acecombat

#3
Aug 09, 2012, 10:13 am Last Edit: Aug 09, 2012, 10:18 am by acecombat Reason: 1
I've tried the reset button a few times, I'm not sure when the best time to hit it is...
I guarantee I'll never do this again!!
Any other tricks people know of that I could try?

pYro_65

#4
Aug 09, 2012, 10:25 am Last Edit: Aug 09, 2012, 10:27 am by pYro_65 Reason: 1
After the 'compiled to x of y bytes...' message
I find I have to release a tiny fraction before the uploading message would appear. Even hold down the button until compiled then release at the perfect moment. I doubt you need to install a bootloader again.

There are many other factors that could be preventing its upload.
Go into 'device manager' and delete the driver for your arduino, then re-install, make sure you are using a root USB port, not one at the front of pc or monitor hub, try and use the same usb port, restart PC in case something isn't closing serial comms...

Try the serial loopback test ( on forum somewhere ) with IDE or another serial monitor << this forum actually ( Installation & Troubleshooting )

acecombat

It's not a driver issue as I can upload to another fine.  This one worked prior to me uploading it's current program.
The loopback doesn't do anything on this board, on the working one it echo's as expected.  Perhaps I've damaged something along the way?
It still appears to be functioning correctly when I first power it on it shows up on my oscilloscope when the RX light flashes.  Then the code loads and turns it active and it can drive an LED.

acecombat

I've just programmed my other Arduino as an ISP and get the following when I'm trying to write the blank program with the Upload Using Programmer option.
Both are 2560's and it flashed the ISP program to the other fine:

Binary sketch size: 666 bytes (of a 258,048 byte maximum)
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

If I change force it will it break something?  How do I add the -F into the Arduino software?

Go Up