This is a quick video tutorial to explain how to re-flash the attiny45 in ardupilot boards. You can also tweak the attiny code if you wish...

But first you need to fallow this steps:

1.-Buy an AVRISP MKII programmer, you can buy one in DIGIKEY, MOUSER and FARNELL (for Europeans)

2.-Download and install AVR Studio from here, if the link don't work try this one (you must register). When your are installing it, when it ask about "Jungo Drivers", say always "Yes, yes and yes!" (are AVRISP drivers).

3.-Now AVR studio will only let you program ATMEGAS in assembler (yeah, sure). For C/C++ you must install the WINAVR (AVR GCC). It will automatically fuse with AVR Studio, so don't worry about anything else... The main page is here, and the direct download here. After download, install it please.

4.-Now plug you AVRISP programmer and make sure the drivers are well installed, if you want to know more about AVR studio and AVRISP please read here (very suggested).

5.-Download the Fail Safe firmware (or code), to download the one i'm using in the video click here. Lasted updates will be published here. You can also download the HEX directly here, if you want... ;-)

6.-Watch my quick-made video:

Views: 2385

3D Robotics
Comment by Chris Anderson on January 27, 2009 at 3:17pm
For those of you who want a shortcut and don't want to modify the C code or otherwise use the compiler function in AVR Studio, you can actually skip several of these steps and just upload the HEX file directly.

In that case, you don't have to install WINAVR, and you can skip some of the AVR Studio steps in the video. Instead, once you've got the AVR programmer connected and you're in AVR Studio, just go to Tools/Program AVR/Connect, then press connect (you may get an error, which doesn't matter; click cancel). You'll need to select the Attiny45, and check that it's reading the right signature. Now go to the Program tab. Where it says "Flash", input our firmware hex file, which you can download here.

That's it! The new firmware should be working.
Comment by jonny on January 28, 2009 at 4:50am

Nice, this is more like it, very well explained and I'm sure quite a number of people will find it usefull also. I have located an AVR programmer and it is on its way, so if anyone else would like a lend of it and dont mind paying the postage I will pass it round as soon as I have programmed my boards. Once again thanks for the tutorial Jodi you have saved me a lot of time!

Comment by Jordi Muñoz on January 29, 2009 at 10:04am
You welcome Jonny!
Comment by Reto on February 11, 2009 at 1:52pm
I have following fuses which can be set in my AVR program.
I tried to figure out from the movie which has to set off, but I could not read it from the movie nor find a complete list for fuse settings for the Attiny45 on ArduPilot. Could someone please tell me which of the above fuses I should set to 1.
I would greatly appreciate this information.

3D Robotics
Comment by Chris Anderson on February 11, 2009 at 3:01pm
The fuses should look like this:

Comment by Reto on February 11, 2009 at 3:17pm
Thanks Chris for this better image of the fuse settings.
I don't know for sure, but something probably went wrong with my last try: since I had no risky SPIEN modifiable fuse visible in my programmer, I tried to program with all fuses off, including my SUTs, CKSELs, BODLEVELs and RSTDISBL. But after that, my programmer did not recognize the ATTiny45 anymore!!! I suspect I have now a locked device on which I cannot change anything anymore and which could only be saved through a high voltage programming. Could this be in yur opinion? If so, is it possible to do it with the chip on board by powering the RESET ISP pin with 12V? Or in doing so am I risking something bad for the board or components?
With my way of trying out things too fast, it is certainly not the last time I'll need some help. Sorry for that. But I felt I was almost on the right path resolving the MUX issue. anyhow, thanks for all your support.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service