About writing ATmega 32A Fuse bits

Discussion in 'Embedded Systems and Microcontrollers' started by etech7, Mar 20, 2017.

  1. etech7

    Thread Starter Member

    Jun 9, 2015
    38
    0
    Hellow there! I am learning atmel AVR uC. I am confused about the fuse bits. I am using AVRpal.net burner program, USBasp programmer. Here is my questions:

    1. My ATmega32A is brand new. Do I need to change the fuse bits? I learned that they are configured default.
    2. Can I write fuse bits more than once? I mean, can I change them again if required? (I'm confused with ROM made of fuses. Where they can be programmed once only)
    3. If I write the fuse bits once do I need to configure them again before flashing uC with new code?
    4. If I apply erase command will it clear the fuse bits altogether? hence requires fuse bits to be programmed again?

    -Thanks
     
    Last edited: Mar 20, 2017
  2. mtonge

    Member

    Apr 19, 2016
    78
    28
    From Lady Ada's tutorial:
    You know about flash, eeprom and RAM as parts of the chip. What I did not mention is that there are also 3 bytes of permanent (by permanent I mean that they stick around after power goes out, but that you can change them as many times as you'd like) storage called the fuses. The fuses determine how the chip will act, whether it has a bootloader, what speed and voltage it likes to run at, etc. Note that despite being called 'fuses' they are re-settable and dont have anything to do with protection from overpowering (like the fuses in a home).
    The entire tutorial can be found at: http://www.ladyada.net/learn/avr/fuses.html .
     
    etech7 likes this.
  3. mtonge

    Member

    Apr 19, 2016
    78
    28
    I just read that article and it is helpful but not complete. Just search 'avr fuse bit tutorial', there are many articles out there (and fuse bit calculators too).
     
    etech7 likes this.
  4. Papabravo

    Expert

    Feb 24, 2006
    11,210
    2,214
    In general the fuse bits return to their default state each time you do a bulk erase on the chip, which is usually the first step in most programmers.
     
    etech7 likes this.
  5. DickCappels

    Moderator

    Aug 21, 2008
    4,050
    1,164
    1. No

    2. Yes

    3. Usually no.
    The programmers I have used flash the code separately from the fuse bits except when using an elf file to control the programming.

    4.See Papabravo's explanation
     
    etech7 likes this.
  6. etech7

    Thread Starter Member

    Jun 9, 2015
    38
    0
    I read the article. Obviously useful but still confused. To get rid of these confusion I visited several website but still no solution.
     
  7. etech7

    Thread Starter Member

    Jun 9, 2015
    38
    0
    So, there is no way to accidentally alter the fuse bits in wrong way, if I apply erase command or unless if I try to alter them consciously.
     
  8. etech7

    Thread Starter Member

    Jun 9, 2015
    38
    0
    Thanks! I looked well the AVRpal.net interface. There is separate option to read/write the fuse bits. I expect that erase command will only clear the flash space.
     
  9. DickCappels

    Moderator

    Aug 21, 2008
    4,050
    1,164
    Atmel programmers have an "Erase Device" commant that erases the flash, EEPROM, and sets the fuses to (apparently) factory default. This is a wonderful improvement that means that if you lock the chip to prevent further reads/writes the Erase Devices command makes it possible to reprogram the device without having to resort to high voltage programming.
     
Loading...