Rewriting lfuse and hfuse of Atmel Atmega series

Atmel Atmega micro controller if set correctly will work fine. But when you tinker with its setting. Things get out of control. One such problem is when you set the wrong fuse setting of the device to use the external crystal oscillator.

  1. Connect the microcontroller with the USBASP programmer
  2. Open the command prompt 
    Win+r
  3. write the command
    avrdude -c usbasp -p m32 -t
  4. This will open a terminal where you will write
    read lfuse
  5. Note down the settings
  6. Then write 
    read hfuse
  7. Calculate the correct fuse setting and then write
    avrdude -c usbasp -p m32 -U lfuse:w:0xe1:m -U hfuse:w:0x99:m

NOTES:

These setting specified in the above post is incorrect. 
Calculate the fuse setting in advance
Also remember the JTAG pin will also be set correctly
Never Change SPI setting without reading document. Changing this setting will result in non-functioning of SPI and the programming can only be done with manufacturer programmer. 

The above said procedure is verfied on the follwing micrcontrollers:

  • ATMEGA16
  • ATMEGA32
  • ATMEGA32A

Leave a Reply

Your email address will not be published. Required fields are marked *