# High voltage programmer can reset lock bits without loosing code or program from atmega328?

**URL:** <https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131>\
**Category:** Programming\
**Created:** [July 6, 2023, 5:49am UTC](https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131 "2023-07-06T05:49:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pradippatel80494](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pradippatel80494/32/976370_2.png) [@pradippatel80494](https://forum.arduino.cc/u/pradippatel80494)\
**Post date:** [July 6, 2023, 5:49am UTC](https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131/1 "2023-07-06T05:49:49Z")

</div>

anyone explain :  
High voltage programmer can reset lock bits without loosing code or program from atmega328?

> **[Gammon Forum : Electronics : Microprocessors : High-voltage programming for...](http://www.gammon.com.au/forum/?id=12898)**
>
> Gammon Forum : Electronics : Microprocessors : High-voltage programming for AVR chips

---

<div class="post-metadata">

**Author:** ![b707](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/b707/32/854321_2.png) [@b707](https://forum.arduino.cc/u/b707)\
**Post date:** [July 6, 2023, 6:17am UTC](https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131/2 "2023-07-06T06:17:43Z")

</div>

No, the current code in the flash will be deleted  
Otherwise there would be no point in lock bits

From the Atmega328 datasheet (chapter 26.5):

> Lock bits can be set in software in Serial or Parallel Programming mode, but **they can be cleared by a Chip Erase command only.**

---

<div class="post-metadata">

**Author:** ![pradippatel80494](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pradippatel80494/32/976370_2.png) [@pradippatel80494](https://forum.arduino.cc/u/pradippatel80494)\
**Post date:** [July 6, 2023, 6:40am UTC](https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131/3 "2023-07-06T06:40:27Z")

</div>

> [@Understanding Lock Bits, Fuse Bits and Code Security](https://forum.arduino.cc/t/understanding-lock-bits-fuse-bits-and-code-security/979657/3):
>
> The only way to clear the lock bits is a full chip erase. However, the lock bits will not normally prevent the code from being read by the bootloader.

---

<div class="post-metadata">

**Author:** ![b707](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/b707/32/854321_2.png) [@b707](https://forum.arduino.cc/u/b707)\
**Post date:** [July 6, 2023, 6:48am UTC](https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131/4 "2023-07-06T06:48:07Z")

</div>

To do this you need to edit bootloader first. But you can't if the lock bits forbids it.

---

<div class="post-metadata">

**Author:** ![pradippatel80494](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pradippatel80494/32/976370_2.png) [@pradippatel80494](https://forum.arduino.cc/u/pradippatel80494)\
**Post date:** [July 6, 2023, 6:57am UTC](https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131/5 "2023-07-06T06:57:28Z")

</div>

[![](https://europe1.discourse-cdn.com/arduino/original/4X/d/3/d/d3d1267249f267c8c21d23a6f172920885a1b15e.jpeg "Unlock Atmega Attiny Fuse Doctor Fuse Repair Programmer") ](https://www.youtube.com/watch?v=zejNHjNHCkw)

please see in this video programmer jumper prevent the code.

---

<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:** [January 2, 2024, 6:58am UTC](https://forum.arduino.cc/t/high-voltage-programmer-can-reset-lock-bits-without-loosing-code-or-program-from-atmega328/1145131/6 "2024-01-02T06:58:04Z")

</div>

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