To load the failsafe firmware on ArduPilot's Attiny chip, you need to do the following.

1) You'll need an ICSP AVR programmer. We recommend AVRSIP2. Connect the cable to the correct ICSP port on your board, as shown above. The red stripe on the cable should be on the same side of the connector as the square solder pad on the back of the board. (On our boards that means that the red strip is on the side closest to the processor)

2) Now you'll need to change (turn off) one of the default "fuse" settings in the Attiny45, which divides the internal clock by 8 so it only runs at 1 Mhz. (Explanation of all that and more about fuses are in the excellent Sparkfun tutorial here). Run the AVR Studio program that came with the AVRSIP2 programmer. Ensure that the board is powered on by connecting it to an ESC or other power source! The red LED on the board should be on.

3) To change the fuse with AVR Studio, connect the programmer and go to Tools/Program AVR/Connect. Choose AVRISP mkII. You may get an error (choose cancel). On the "Main" tab of the dialog, click the "Settings" button and pick 125khz and click "Write". Then make sure "Device" is Attiny45 and "Read signature". At the bottom it should say that all's okay. If so, switch to "Fuses" tab and uncheck CKDIV8. Press "Progam", then "Verify" to make sure it's woking. [Note for those who are curious: the AVR programmer can only work at 1/4 of the clock speed of the chip. The Attiny ships with a 8Mhz internal clock, but when that DIV8 fuse is set it's only running at 1Mhz, so the programmer must be running at less than 250khz. Once you clear that fuse and the chip is running at full speed, the programmer can run at 2Mhz, which is 1/4 of 8Mhz]. Your processor is working fine and ready to program.

4) Now you'll need to burn the firmware. Still in the AVR Studio dialog box you used above, go to the Program tab. Where it says "Flash", input our firmware hex file. If you've already downloaded it in some folder, you can select that here. If not, switch to your browser and download this file. Click "Program". All should go well and you'll see the OKs below. If you want to make sure it's working, you can click "Verify". Now you can go back to the "Main" tab and change the Settings to 2Mhz.

That's it! The failsafe should be working now. Connect the CTRL lead to channel 5 or 6 of your RC receiver and power on the ArduPilot board. When you toggle that channel a red LED should go on and off on the ArduPilot board, indicating that control of the output channels is being switched from the RC receiver to the autopilot or vice versa. For extra fun, toggle it back and forth fast five times. That should reset the autopilot (for in-air recovery).

Views: 8532

Comment by smguest on February 2, 2009 at 8:32pm
One note that might be handy to add is that you need to power the ArduPilot in order to program the ATTiny. Without external power, AVR Studio could still read the signature and match it to the ATTiny45, but I'd get verify errors when I tried to program it. I made the bad assumption it was going to be like programming the Arduino Duemilanove via a USB connection and no external power would be needed. I saw that the board needed to be powered to program the main chip so left it powered and tried the ATTiny again and it worked!

It now looks like I have a functioning ArduPilot board since the mux and mode lights now change according to switch position on the input channel.

Comment by Saiful Azuwan on February 2, 2009 at 9:01pm
Hi smguest,

Did your board come with or w/o PSEL hole?
Comment by smguest on February 2, 2009 at 9:09pm
I have the pins with the jumper for PSEL.
Comment by Saiful Azuwan on February 2, 2009 at 9:11pm
I see this meaning your board come w/o MUX code right? Btw thanks for give some feedback. Now I waiting for my AVR programmer.
Comment by smguest on February 3, 2009 at 6:35am
Yes, mine was one of the earlier batches that did not appear to have the code for the ATTiny. I purchased a programmer and followed the instructions above but until I powered the board separately, it didn't work. Otherwise, it was straight forward so you shouldn't have any problems when your programmer comes in.
Comment by Saiful Azuwan on February 3, 2009 at 6:42am
Thanks smguest...

3D Robotics
Comment by Chris Anderson on February 3, 2009 at 8:58am
Thanks for the reminder to mention that the board should be powered on. Post now updated to say that.
Comment by Saiful Azuwan on February 5, 2009 at 10:14am
Thanks to Chris, Jordi, smguest & everyone here. My ArduPilot was funtion fully 100% now after reflash the Attiny45. Keep on going guys...
Comment by John on February 7, 2009 at 12:24pm
Thanks for the update this may clear up the issues with my board, did any of you guys have an issue with the GPS lock LED initializing befor the ATTiny fix? Have two boards and both arent registering the GPS lock from the 406-a, when I have independently verified the GPS is behaving correctly under the same baud rate..
Comment by Reto on February 10, 2009 at 5:33am
Hi all. My ArduPilot board finally arrived from Sparkfun. Since it was notified as shipped the 1/30/2009, should I expect to have to order and AVR programmer to reprogram the Attiny or is there any simple test I could do to know if the fuse is set correctly or not.


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

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service