Pages: [1]   Go Down
Author Topic: Stand-alone fuse calculator for your chips  (Read 2776 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19358
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

After reading various posts from people saying "but what are my fuses set at?" ... I thought it would be handy to be able to find out, preferably without having to hook the board up to a programmer.

The sketch I developed is similar to the one which detects what sort of chip you have by entering ICSP programming mode and querying the chip. The wiring is identical, and is described here:

http://www.gammon.com.au/forum/?id=11633

Basically you connect up the board with the sketch, to the target board, with 6 wires, along these lines:



Then the sketch finds the fuse settings and attempts to render them in a readable way:

Code:
Atmega fuse calculator.
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768
LFuse = 0xFF
HFuse = 0xDE
EFuse = 0xFD
Lock byte = 0xCF
External Reset Disable.................. [ ]
Debug Wire Enable....................... [ ]
Enable Serial (ICSP) Programming........ [X]
Watchdog Timer Always On................ [ ]
Preserve EEPROM through chip erase...... [ ]
Boot into bootloader.................... [X]
Divide clock by 8....................... [ ]
Clock output............................ [ ]
Bootloader size: 512 bytes.
Start-up time: SUT0: [X]  SUT1: [X] (see datasheet)
Clock source: low-power crystal.
Brownout detection at: 2.7V.

Or for the ATmega16U2 on the Uno Rev 3:

Code:
Atmega fuse calculator.
Entered programming mode OK.
Signature = 0x1E 0x94 0x89
Processor = ATmega16U2
Flash memory size = 16384
LFuse = 0xEF
HFuse = 0xD9
EFuse = 0xF4
Lock byte = 0xCF
Hardare Boot Enable..................... [X]
Debug Wire Enable....................... [ ]
External Reset Disable.................. [ ]
Enable Serial (ICSP) Programming........ [X]
Watchdog Timer Always On................ [ ]
Preserve EEPROM through chip erase...... [ ]
Boot into bootloader.................... [ ]
Divide clock by 8....................... [ ]
Clock output............................ [ ]
Bootloader size: 4096 bytes.
Start-up time: SUT0: [X]  SUT1: [X] (see datasheet)
Clock source: low-power crystal.
Brownout detection at: 3.0V.

And the Mega board:

Code:
Atmega fuse calculator.
Entered programming mode OK.
Signature = 0x1E 0x98 0x01
Processor = ATmega2560
Flash memory size = 262144
LFuse = 0xFF
HFuse = 0xD8
EFuse = 0xFD
Lock byte = 0xCF
OCD Enable.............................. [ ]
JTAG Enable............................. [ ]
Enable Serial (ICSP) Programming........ [X]
Watchdog Timer Always On................ [ ]
Preserve EEPROM through chip erase...... [ ]
Boot into bootloader.................... [X]
Divide clock by 8....................... [ ]
Clock output............................ [ ]
Bootloader size: 8192 bytes.
Start-up time: SUT0: [X]  SUT1: [X] (see datasheet)
Clock source: low-power crystal.
Brownout detection at: 2.7V.

Code here:

http://gammon.com.au/Arduino/Atmega_Fuse_Calculator.zip

Use at your own risk. It is incredibly tedious keying in the fuse meanings, so if you find any errors please let me know.
Logged

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

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It is incredibly tedious keying in the fuse meanings

A few days ago I crossed paths with an Atmel document that very nicely organized all the fuse bits.  Let me know if you're interested and I'll try to hunt it down.
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19358
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That would be great, thanks!
Logged

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

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Don't thank me yet (well, you can thank for the effort).  I may not be able to resurrect enough of the memory.  What really pisses me off is I can distinctly remember what the grid looks like just not how I found the document or what else was in the document.  Stupid brain.  Why must you mock me!
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19358
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

 What really pisses me off is I can distinctly remember what the grid looks like just not how I found the document or what else was in the document.  Stupid brain.  Why must you mock me!

That happens to me all the time. Which is why I take on short-term projects. smiley-sad
Logged

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

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's awesome.  Great idea, Nick. smiley-cool
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I found it!  Unfortunately, it's woefully out of date (pages 23 - 27)...
http://www.atmel.com/Images/doc2525.pdf
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19358
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Better than nothing, thanks!
Logged

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

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Pages: [1]   Go Up
Jump to: