I like exploring things. When a problem occurs, I like finding out what went wrong... and I like correcting mistakes I made!
When ArduPilot came in, step 1 was to check if the CKDIV8 fuse setting was correct... It wasn't. CTRL not working.
Step 2: set the fuse correctly. For that, I needed an AVR programmer... no programmer in the house (I'm a newbie).
Step 3: get an AVR programmer:
- option A: buy what was recommanded on this site (easy way)
- option B: do one myself (hard way)
Step 4 (I chose option B): get information (AVR programming), choose an easy hardware solution (I chose the DAPA parallel cable solution), do it (cutting an end of a DB25 cable, wiring as information found online to an ISP connector)
Step 5: get free programmer software from the web which accommodates DAPA AVR cable... found it
Step 5: connect the AVR DAPA cable to ArduPilot's ISP pins, load software, try out reading the signature of the ATtiny45 chip... it works!
Step 6: take a look at the fuses... seems logic and easy, but there, the newbie mistake happens:
I thought "fuse = 1 = set" "fuse = 0 = not set".... MISTAKE, but I did not know at the time!!!
Step 7: setting the fuses as recommended on DIYdrones with help of available information understood by a newbie:
I turned all fuses = 0.
Step 8: checking if CTRL works... nope!
Step 9: connecting the ISP again to check the fuses... ATtiny not recognized by the AVR, no signature read!!!
Step 10: the newbie is stuck, reads some more online information, finds out that fuses set = 0 are ENABLED (not disabled as previously thought). I find out that the RSTDISBL fuse, once enabled, blocks ISP access to the ATtiny45. I also found out that DWEN enabled can cause problems for ISP. Fortunately, SPIEN was not reprogrammed (not accessible with the programmer software I used).
Only solution to get the RSTDISBL fuse set = 1 again is called "High Voltage Programming". But for that, one needs an adapted AVR programmer capable of applying 12V to the RESET pin of the ATtin45. And this probably cannot be done with the chip installed in a 5V circuit.
Step 11: the newbie asks for some more help with some simple questions:
a) Has someone experienced doing a High Voltage Programming of a uC installed in circuit? What precautions have to be made.
b) Is it possible to disconnect the uC from the board to HV program it, and then reinstall it again?
c) Would it be easier to buy a new uC, flash it, and setting it on the board?
d) Does the ATiny45 need having its EEPROM programmed? Where can I find the necessary EEPROM hex file? Or is the flash hex all it needs?
Additional information about my setup:
- I ordered an AVRISP STK500, but it could take some time to get in (the item is sold for 80 USD in Switzerland, so I ordered from abroad for 35 USD!
- I also ordered an Arduino Duemilanove, breadboard and components... I found someone having done a High Voltage AVR for setting wrong fuses with an Arduino board (another way to learn a lot of things).
Well, so far as a newbie, I learned a lot from all this... the hard way. And since I am as I am, I'll probably go on that way.
Of course, in the meantime, my Kadet Senior airframe is not getting much further...
But in the meantime, if someone is willing to share some experience or help, I'll welcome him.