Society of Robots - Robot Forum

Software => Software => Topic started by: jaime on October 12, 2009, 09:48:54 PM

Title: Axon AVRDUDE and screwed up fuses...
Post by: jaime on October 12, 2009, 09:48:54 PM
I'm not even sure what a fuse is, but I think I may have screwed up my Axon.

I was uploading a program to it using avrdude, and didn't realize that:

1.  My axon was plugged into the USB port
2.  My axon was not powered

I've pasted my avrdude session below.  Now the programmer won't recognize the axon.  I've tried using the -F option to ignore this, but it simply won't write the program.

Have I bricked my Axon?

Thanks!

jaime

Code: [Select]
$ avrdude.exe -c avrisp2 -P com1 -p m640 -U flash:w:Axon
.hex

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x000000
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo
rmed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "Axon.hex"
avrdude.exe: input file Axon.hex auto detected as Intel Hex
avrdude.exe: writing flash (12132 bytes):

Writing | ################################################## | 100% 3.60s

avrdude.exe: 12132 bytes of flash written
avrdude.exe: verifying flash memory against Axon.hex:
avrdude.exe: load data flash data from input file Axon.hex:
avrdude.exe: input file Axon.hex auto detected as Intel Hex
avrdude.exe: input file Axon.hex contains 12132 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 2.66s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
             0x0c != 0x00
avrdude.exe: verification error; content mismatch

avrdude.exe: safemode: lfuse changed! Was 0, and is now ff
Would you like this fuse to be changed back? [y/n] y
avrdude.exe: safemode: and is now rescued
avrdude.exe: safemode: hfuse changed! Was 0, and is now c0
Would you like this fuse to be changed back? [y/n] y
avrdude.exe: safemode: and is now rescued
avrdude.exe: safemode: efuse changed! Was 0, and is now fc
Would you like this fuse to be changed back? [y/n] y
[b]avrdude.exe: and COULD NOT be changed[/b]
avrdude.exe: safemode: Fuses not recovered, sorry

avrdude.exe done.  Thank you.
Title: Re: Axon AVRDUDE and screwed up fuses...
Post by: Admin on October 13, 2009, 09:27:39 PM
It looks like it was bricked.

Here is how to save it:
http://www.societyofrobots.com/axon/axon_FAQ.shtml#brick (http://www.societyofrobots.com/axon/axon_FAQ.shtml#brick)
Title: Re: Axon AVRDUDE and screwed up fuses...
Post by: jaime on October 14, 2009, 09:20:43 AM
Thanks a bunch!  Steps 1, 3 and 4 I can handle.  I need help with 2.

Quote
Apply a square wave to XTAL1 (say 125KHz, 250KHz, etc). Ground to ground.

First, where is XTAL1?   From what I've read it's a point on the axon somewhere, I just don't know where.

Next, how do I create a square wave?  Can I do it with another Axon?

Thanks for bearing with the electronics newbie!

jaime
Title: Re: Axon AVRDUDE and screwed up fuses...
Post by: Admin on October 14, 2009, 09:45:47 AM
Quote
First, where is XTAL1?
There are only two pins on a crystal, so that narrows it down! Then just see the pinout in the datasheet, and/or the schematic - also in the Axon datasheet.

Quote
Next, how do I create a square wave?  Can I do it with another Axon?
Any microcontroller can do it - just use PWM. Or find a function generator in a lab.

A 555 timer IC can do it, too.
Title: Re: Axon AVRDUDE and screwed up fuses...
Post by: pomprocker on October 14, 2009, 10:00:30 AM
Here maybe another way:

http://www.societyofrobots.com/member_tutorials/node/239 (http://www.societyofrobots.com/member_tutorials/node/239)

or (if you have an Arduino laying around)

http://www.mightyohm.com/blog/products/avr-hv-rescue-shield/ (http://www.mightyohm.com/blog/products/avr-hv-rescue-shield/)

Title: Re: Axon AVRDUDE and screwed up fuses...
Post by: jaime on October 15, 2009, 09:02:06 AM
Quote
First, where is XTAL1?
There are only two pins on a crystal, so that narrows it down! Then just see the pinout in the datasheet, and/or the schematic - also in the Axon datasheet.

Quote
Next, how do I create a square wave?  Can I do it with another Axon?
Any microcontroller can do it - just use PWM. Or find a function generator in a lab.

A 555 timer IC can do it, too.

Found the XTAL1 in the axon schematic.  I'm becoming dangerous with my new found knowledge!

Now, before I do this, let me get a few more specifics...

For the PWM, how often should I pulse?  I know it mentions 125KHz, 250KHz but I'm not sure how to translate that into microseconds.

Next, once I'm ready to pulse the bricked Axon using the good Axon, should the bricked Axon be powered?

Thanks!
jaime
Title: Re: Axon AVRDUDE and screwed up fuses...
Post by: Admin on October 15, 2009, 09:18:26 AM
Quote
I know it mentions 125KHz, 250KHz but I'm not sure how to translate that into microseconds.
Frequency, as in Hz, is 1/time, or 1/s.

So 1/Hz is time in seconds.

One second is 1x10^-6 us.

1 / 125000 Hz = 8.0x10^-6 s, meaning 125KHz is one pulse per 8 us. (on 4us, off 4us)

Quote
should the bricked Axon be powered?
yeap