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: 8197


3D Robotics
Comment by Chris Anderson on November 18, 2009 at 5:37am
Use the at168 pins
Comment by Harry on November 19, 2009 at 2:14am
"Use the at168 pins"... hmmm, that would be to load the bootloader? Just slide the AVRISP mkII connector over to the next 6 pins, same orientation? The red stripe closest to the Attiny side?

In either case, I have big problems now with the USB/Serial drivers for FTDI and AVRISP mkII. These items were higher on the checklist and in the month that ArduPilot was running, MS did an upgrade. Now, I cant get reliable connection through the USB. Sometimes when I connect, it says unrecognized USB device, other times I get jibberish on hyperterminal, mostly nothing comes through and status light goes out on ArduPilot.

I dont know where to start to correct it. I want to wipe out all the USB related drivers, but not sure which ones to delete and exactly where they are.

Should this have it's own thread in ArduPilot? The problem is probably something somebody else will experience eventually.

3D Robotics
Comment by Chris Anderson on November 19, 2009 at 6:52am
Harry, the first thing I'd do is to reload the FTDI driver (I think it's unlikely that you'll need to reload the bootloader with AVRISP). The link is in this troubleshooting post, which you've no doubt already been through (it's linked in the manual). If you've gone through all that and it's still not working, you can turn to the bootloader. The easiest way to load it is through the Arduino IDE, but there's a driver conflict with the AVRISP II driver, so if you need to get to that point I'll walk you through the solution.
Comment by Craig Burden on March 1, 2010 at 12:11pm
So the ardupilot is basiclly a compact arduino with specalised pins for servos ect? No programing provided?

3D Robotics
Comment by Chris Anderson on March 1, 2010 at 12:28pm
Craig, I don't understand your question. What do you mean "no programming provided"? ArduPilot is an Arduino-compatible board optimized for autopilot use and very complete software to run it. Please use the tabs above to learn more.
Comment by Craig Burden on March 15, 2010 at 10:06am
what im saying is that the ardupilot is a compact arduino that you must program your self? or does it come preprogramed?

Comment

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

Join DIY Drones

© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service