Go Down

Topic: getting to grips with fuse bits (Read 719 times) previous topic - next topic

knuckles

these represent a grey area for me although i have used em for booloading on unos using examples but i didnt really appreciate what i was doing with the fusebits .
i just copied the examples.
so is there a succint text that would give me some idea on which ones to use and where ?
should i just start with the data sheet for each chip and that would give me all the possible fusebits i could use for a given project ?
some fusebits could be the kiss of death for my chip so i dont want to use the wrong selection that could have dire results .
how many possible fuse bits are there for a given chip ,say the uno or mega ?

johnwasser

The datasheet is the definitive reference for which bits do what.   In the Arduino environment the Burn Bootloader process sets the fuses and you don't need to worry about it.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

retrolefty

#2
Dec 12, 2012, 07:16 pm Last Edit: Dec 12, 2012, 07:19 pm by retrolefty Reason: 1
Quote
how many possible fuse bits are there for a given chip ,say the uno or mega ?


Again a specific AVR datasheet is the bible to learn about it's specific fuse bits. Most all the bits are grouped into either two or three fuse bytes (depending on the specific AVR chip in question) named hFuse, lFuse, and eFuse. The only exception might be the Lock Bit fuse which may be a 'standalone' bit not grouped with any of the other fuse bytes, but that has never been totally clear to me.

Anyway the arduino core file boards.txt contains the proper value for the fuse bytes to be used with each of the defined board types that the IDE is setup to work with. The only time the Arduino IDE writes fuse bytes to the chip is when performing the burn bootloader operation from the IDE. Uploading sketches does not change or check fuse bits. Of course if you use AVRDUDE program in standalone command line mode you can read or write any fuse values you wish to, but caution some fuse settings can effectively 'brick' the chip requiring a HV (high voltage) programmer to undo that situation.

Often confusing is that any specific fuse bit option is enabled (turned on) by setting it to a 0, as due to the type of EEPROM memory used in the AVR chips a totally erased chip has all fuse bits set to 1 (off) condition.
Also some bits in the fuse bytes are not used and often shown or read back as zeros with AVRDUDE which can be confusing also.

Lefty

Papa G

if you have $20 you don't need, I think this is a handy tool to have when you are experimenting with fuse settings:

http://mightyohm.com/blog/products/hv-rescue-shield-2-x/


Nick Gammon

This calculator is handy:

http://www.engbedded.com/fusecalc

It doesn't totally tell you why you might want to set certain bits (it does in summary form).

As a general rule, don't fiddle with bits you don't understand. In particular SPIEN (ISCP programming) should stay enabled.

Also, rather confusingly, a fuse bit is "programmed" (set) if it is zero. This is because the default for flash is for everything to start off as 0xFF (1-bits).

As an example for the Atmega328:



The SPIEN bit is programmed (enabled), as you can see, if it is zero.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up