What are fuses? Mega32A

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

I am a newbie and am wondering:

1.  What is a fuse?

2.  When do I need to modify fuses?

3.  How to I modify fuses?

 

I am using an atmega 32A and have been through the entire manual on this device and have found many references to fuses but no details on the above questions.  Any chance you can fill me in?  I am planning to use an external oscillator, do I need to modify fuse settings to make this works as an external clock?

Many thanks for your help,   Dave

David Abineri

Last Edited: Sat. Sep 19, 2015 - 12:44 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Re 1.:

Hmmm--I guess that maybe doesn't directly answer your questions.  I'd think that the descriptions in the table above would indicate that they are "chip options", wouldn't it?  How else would you interpret it?

 

I guess "chip options" would be my short answer.

 

Re 2. :  Whenever you want to change the chip options from the default values.  A very common one would be to enable the BOD detector, at a certain level.  Options are needed as one size does not fit all.

 

Re 3. :  That depends on your ISP system and toolchain.

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Thank you for your responses.  Yes, I see them as chip options but a little cryptic. 

 

"Enable OCD", "ENABLE JTAG"...?

 

What is a " BOD detector"

 

At what point in program execution or downloading must these options be changed?

 

Do I need to change any if I plan to use an external crystal rather than the internal? Does the change depend on the frequency of the crystal? How to I change a fuse?

 

I find that these are questions that do not seem to be addressed clearly in the manual. 

 

Can you be of any help here or point me in the right direction perhaps. I am using Atmel Studio and USBTiny.

 

Thanks again for your help,  Dave

David Abineri

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

I find that these are questions that do not seem to be addressed clearly in the manual. 

Open up the manual in your favourite PDF reader. Hit the search button. Enter "OCD". You will likely find a chapter or section named "On-Chip Debugging" or something similar. 

 

BOD - Brown-Out Detector

 

Do I need to change any if I plan to use an external crystal rather than the internal? Does the change depend on the frequency of the crystal?

Open up the data sheet as before. Look through the Table Of Contents. Is there any section named "fuses" or similar? Hint: Yes, "29.2. Fuse bits". Go there and locate the tables of the fuse bits.

 

Does any of the fuse bit names suggest that they have something to do with this? (Hint: "Select Clock Source"). 

 

Below the table there is a paragraph of "Related Links", one of which is named "Clock Sources". Go there.

 

To understand what you are dealing with, start reading at 12.2 and read all the way through 12.8 . Now you know what the CKSEL3..0 bits of the fuses control.

 

Most everything is covered in detail in the data sheet. It's just that it's A LOT of information. And it is sort of organized as a "reference manual" rather than a "users guide", and not at all as a "tutorial". Still, you must get used to read the data sheet, looking for different information in different places, and then do your combination and "adding up" of the information you seek at a specific time. This is hard to begin with, but there is no way around it apart from practice, and more practice.

How to I change a fuse?

With your programmer and programming software. Since your programmer is a USBTiny, can we assume that you are using AVRDUDE as programming software? Without knowing that, no specific information can be given.

 

IMPORTANT! WARNING!: Fiddling with the fuses without knowing exactly what you do might render the AVR un-programmable with only the USBTiny. Do not touch fuses until you have fully understood the consequences of doing so, and having read up thoroughly on how to go about it!

 

Search this forum for e.g. "bricked" for many previous tales from frustrated and disappointed beginners with AVRs.

 

(The somewhat more detailed story is: In order to be successfully programmed the AVR needs to be fed a good clock signal. By default this is the internal RC Oscillator. If you program the fuses to make the AVR use another clock signal that actually isn't there the chip will no longer be programmable with your USBTiny. In almost all cases the chip will be salvageable, but it will likely require extra circuitry and/or equipment.)

 

Be a smart person and don't fiddle with the fuses until you've gained more experience and knowledge. Stay with the internal RC Oscillator as long as possible.

 

You have been warned..

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Thanks again for your help, this makes things a little clearer.

I also found a reasonable site that seems to spell this out ( http://treehouseprojects.ca/fuse... )

 

I wonder why, in the table titled CRYSTAL OSCILLATOR OPERATING MODES that the range of frequencies is:

.4 - .9, .9 - 3, 3-8, and then >1 (MHz)  . The last category seems to include the second and third ranges so which CHKSEL 3..1 does one choose for a 16 MHz crystal, for example?

 

I appreciate your time on these answers, they have helped.

David Abineri

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

dabineri wrote:
I wonder why, in the table titled CRYSTAL OSCILLATOR OPERATING MODES that the range of frequencies is:

.4 - .9, .9 - 3, 3-8, and then >1 (MHz)  . The last category seems to include the second and third ranges so which CHKSEL 3..1 does one choose for a 16 MHz crystal, for example?

The last entry has CKOPT=0.  The first three have CKOPT=1.

 

The difference is explained in the first paragraph of the same section (section 8.4):

 

 

Note also that the CKOPT fuse has a different meaning depending on which clock source is selected.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Sat. Sep 19, 2015 - 01:01 AM