Go Down

Topic: 328P fuse settings (Read 6209 times) previous topic - next topic

paulb

Feb 14, 2009, 06:21 am Last Edit: Feb 14, 2009, 06:37 am by paulb Reason: 1
I'm puzzling through the fuse settings in Arduino 13 and have some questions.


The Boards.txt for the Dicimila / Duemilanove  however describes the fuse settings as:  (rearranged for consistency

diecimila.bootloader.extended_fuses=0x00
diecimila.bootloader.high_fuses=0xdd
diecimila.bootloader.low_fuses=0xff

When I burn the Diecimila 168 bootloader from Arduino and read it in AVR studio, it reads as
Extended: F8
High: DD   (2.7V brownout)
Low: FF        


The high fuse difference is explained by just a difference in brownout detection. What explains the difference in Extended Fuse setting? I remember reading somewhere that AVRdude has a quirk about the high byte in the extended fuse, for some reason.

I guess the main question is: Is the fuse for 1024 words in boot flash set? This would accord with the bootloader requiring about 2k, which is documented somewhere else.

And is the BOOTRST=0  fuse set. It would seem so since 0 equals set.
So the question is mostly about the boot flash section size.



The 328 settings contain another mystery.
When I burn the 328 bootloader with Arduino 13 in which the settings are listed in boards.txt as:

Extended: 0x05
High: 0xDA
Low: 0xFF

and read them back into AVRstudio, I get

Extended: 0xFD
High: 0xDA
Low: 0xFF

The extended fuse setting now only controls brown out detection so the 2.7 volt setting is the same as the previous setting.

However the High fuse setting of DA corresponds to a setting of
"512 words" instead of the previous setting of 1024 words - I'm writing to ask if this is correct?  AVR studio reports that the 1024 word setting should be "D8" (if BOOTRST is also set as before).

It would be nice to see some discussion of the fuse settings (and the design thinking behind choosing various settings). For example,
the Lilypad and Nano both have their own settings and some explanation of the rational behind these settings would be welcome.

I'll be happy to document the fuse settings in AVR studio, and write up this information on fuse settings. Having some answers to the design questions though would make it a much more valuable writeup.

I found a page where LadyAda had started some discussion on fuses but seems to have run out of steam. She also didn't discuss the choices made in the Arduino.

As a tip for those burning quantities of chips, AVR studio is much quicker and provides superior feedback in burning bootloaders onto chips.

paulb




peter247

isn`t the 328p X 2.

What I mean by that is the 328 has 2048 sram and 32 k flash , so isn`t some of the fuses about that ?

I did a upgrade to my asr mkii frimware and found it had change what fuse values I could set .

 
http://peter224722.blogspot.com

mellis

Equal BOOTSZ1 and BOOTSZ0 values give twice the bootloader size on the ATmega328 compared to the ATmega168.  The rest of the weirdness is just avrdude returning 1's for unused fuse bits instead of 0's.

paulb

Thanks for the info David. Can you post a link (or just a pointer) to the place you documented the algorithm for the binary math with AVR dude. Maybe it was in program comments.

For example, how does 0xF8 get to equal AVRdude's 0x00?

paul

mellis

Bits 7 to 3 are unused, so avrdude reads them as a 0, but AVR studio uses 1.

nkcelectronics

@paulb, when I was checking fuses for the 328P, I found it confusing too... if I recall correctly, the 328P has a completely different fuse settings, so it is not just a avrdude conversion, all the bits are mixed-up.   i.e. atmel moved settings from efuse to hfuse/lfuse.

http://www.atmel.com/dyn/resources/prod_documents/doc8025.pdf

pages 296-298

strohhalm

I also tried in the morning to burn the bootloader. With the IDE it was not possible - device "usb" not found - i didn´t want to fiddle around with that. So i tried to do it also with AVR Studio 4.14.

I usually like it to do that with AVRstudio. But i also ran into the fuse settings confusion. Especally regarding the bootloader size. And not really sure about the correct crystal settings.
So i tried also to use the fuses out of the make file, but i got also error messages with AVR Studio after that. But the fuses were set returning another eByte. But i didn´t could verify if they were ok. I did some search but could not find something.
It was brownout at 2.7V but the crystal i don´t remember now - i am at work now.

So it would be very helpful to know what fuses and their meaning have to be set, so one could do it easily with AVR Studio.

About the "usb" not found in the IDE? I am sure i read something about that some time ago, but i don´t know where to find.

Magister

I talked about it last month

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1233260111/1

Atmel changed the fuse registers and swapped bits from one to the other on the 328, compared to the 168.

Go Up