# Fuse bits reset and locked by accident

**URL:** <https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304>\
**Category:** 3rd Party Boards\
**Created:** [March 22, 2023, 4:55pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304 "2023-03-22T16:55:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anakin47](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/anakin47/32/925317_2.png) [@anakin47](https://forum.arduino.cc/u/anakin47)\
**Post date:** [March 22, 2023, 4:55pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/1 "2023-03-22T16:55:42Z")

</div>

I have 3 ATmegas, 1 on an arduino, 1 on an arduino with no bootloader, and another on a custom PCB. I use the first arduino as a programmer for the other 2 deviecs.

I have been programming the ATmega328p using only C and the avr libraries. So no arduino software at all. Ive just been using C, avr-gcc, and avrdude from the command line to program everything.

I noticed just recently that my timer interrupts weren't working as I set them up and I noticed that the all my fuse bits had been changed to 0x00 so I assumed this was the issue.

I have changed the fuse bits in the past using avrdude and ran into no issues, however, this time it errors out every time I try to change them. When I changed the fuse bits in the past I never interacted with the lock fuses only lfuse, hfuse, and efuse.

I suspect the lock fuses have changed and now prevent me from changing the fuses over USB. I know that I can change them over ICSP but every since this error occured I can no longer program my other two devices using the arduino that has the bootloader. I have also tried reburning the bootloader on the second arduino but that errors out.

I have tried to erase the chips using avrdude's -e switch but with no luck. I can still program the first arduino but the timed interrupts are way off.

I am hesitant to setup the high voltage programmer since all my atmegas are TQFP which makes it a hassle to remove and add to a new circuit.

Does anyone know a way I could change the fuse bits? Or a way that I can fix my arduinos so that I can reburn the bootloader back on?

I am also very curious as to what could cause these fuses to be reset in all of my devices. I want to make sure it doesnt happen again. Could my C program have been the culprit or would this be caused by a hardware issue.

Please let me know if you have any insight. Anything would be greatly appreciated

---

<div class="post-metadata">

**Author:** ![anon57585045](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon57585045](https://forum.arduino.cc/u/anon57585045)\
**Post date:** [March 22, 2023, 5:01pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/2 "2023-03-22T17:01:26Z")

</div>

> [@anakin47](#):
>
> I am hesitant to setup the high voltage programmer since all my atmegas are TQFP which makes it a hassle to remove and add to a new circuit.

That feature was deliberately added to provide security. You can be sure no back door was left, otherwise what would be the point?

> [@anakin47](#):
>
> Could my C program have been the culprit or would this be caused by a hardware issue.

Yes, either. If you want advice, you have to give a lot more details of those.

---

<div class="post-metadata">

**Author:** ![anakin47](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/anakin47/32/925317_2.png) [@anakin47](https://forum.arduino.cc/u/anakin47)\
**Post date:** [March 22, 2023, 5:26pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/3 "2023-03-22T17:26:14Z")

</div>

Here is my github repo, [GitHub - anakin4747/atmega: Learning to program AVR atmega328P](https://github.com/anakin4747/atmega)

The source code is in src/ and the Makefile has the commands I would use to flash devices over USB, ICSP, and flashing fuses.

I cant be sure but if it were the code causing the issue, I believe it coincided with the time I moved the code in the ISR to the main.c and had it check for a flag in a global variable called timerInterrupt. But that is just a guess.

---

<div class="post-metadata">

**Author:** ![anon57585045](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon57585045](https://forum.arduino.cc/u/anon57585045)\
**Post date:** [March 22, 2023, 6:15pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/4 "2023-03-22T18:15:29Z")

</div>

Do a high voltage bulk erase and start over.

---

<div class="post-metadata">

**Author:** ![anakin47](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/anakin47/32/925317_2.png) [@anakin47](https://forum.arduino.cc/u/anakin47)\
**Post date:** [March 22, 2023, 6:16pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/5 "2023-03-22T18:16:54Z")

</div>

Am I able to do that without desoldering the chip from the arduino?

---

<div class="post-metadata">

**Author:** ![anon57585045](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@anon57585045](https://forum.arduino.cc/u/anon57585045)\
**Post date:** [March 22, 2023, 6:17pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/6 "2023-03-22T18:17:43Z")

</div>

It depends on your board.

---

<div class="post-metadata">

**Author:** ![anakin47](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/anakin47/32/925317_2.png) [@anakin47](https://forum.arduino.cc/u/anakin47)\
**Post date:** [March 22, 2023, 6:20pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/7 "2023-03-22T18:20:50Z")

</div>

Okay I will look into how to do it without removing,  
Thank you very much for your time and assistance!

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 18, 2023, 6:21pm UTC](https://forum.arduino.cc/t/fuse-bits-reset-and-locked-by-accident/1105304/8 "2023-09-18T18:21:11Z")

</div>

Closed on September 18, 2023, 6:21pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
