trouble programming fuses using avrdude with mega168

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm having some problems programming fuses using avrdude on an atmega168. I tried to isolate the problem using the command line version (usually I just configure my WinAVR/avr-gcc makefile):

avrdude -p m168 -P com1 -c stk500v2 -u -U efuse:w:0xff:m

What's odd is that programming the other fuses (hfuse and lfuse) seems to work just fine. I'm using the version of avrdude that came with WinAVR-20071221. Maybe a more recent WinAVR or avrdude release will fix the problem... or maybe I'm just doing this the wrong way.

Update:
This command still fails to program the efuse in the latest build of WinAVR.

Last Edited: Tue. May 20, 2008 - 06:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, *what*'s your trouble with that command?

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry, here is the output from the command:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9406
avrdude: reading input file "0xff"
avrdude: writing efuse (1 bytes):

Writing | | 0% 0.00s ***faile
d;
Writing | ################################################## | 100% 0.09s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xff:
avrdude: load data efuse data from input file 0xff:
avrdude: input file 0xff contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x07
avrdude: verification error; content mismatch

avrdude done. Thank you.

On both of the other fuses, the verification matches.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I have faced a similar problem with AVRdude.
I use the usbasp programmer but am unable to program any more. The usbasp is not at all detected even though I am able to see it on the Device Manager. Well when I revert back to the older 2007 version it works alright.
I am not sure what has changed since the 2008 release but sure that there is some thing not ok.

AVR Rulez...;-)

Warm Regards,
Boseji
http://m8051.blogspot.com/

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobasaurus wrote:

avrdude -p m168 -P com1 -c stk500v2 -u -U efuse:w:0xff:m

Try:

avrdude -p m168 -P com1 -c stk500v2 -u -U efuse:w:0x07:m -v

and report any failure or success.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
avrdude: verification error, first mismatch at byte 0x0000 0xff != 0x07
avrdude: verification error; content mismatch

Benign, you can ignore that.

https://savannah.nongnu.org/bugs...

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found the solution at:
http://tinker.it/now/2007/02/24/...

It turns out that I was trying to write 1's to the reserved upper bits of efuse, which was failing. On the mega 168, only the lower 3 bits are usable. So, KOCMOC's solution seems to be the right one. Thanks for the help.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bobasaurus wrote:
So, KOCMOC's solution seems to be the right one.

Wasn't mine anyway. I read it from that exact url too but I was too lazy to fetch it again. :oops: