Atmega:

 

1. Protections:

Atmel Atmega family microcontrollers use special configuration bits (Fuses) and Lock Bits to protect program code and data. These bits are set using an external programmer and define the access levels to memory and programming interfaces.

Important: Incorrectly setting the Fuses can lead to a complete lockout of the microcontroller, which may require a high-voltage programmer to recover.

 

1.1 Lock Bits:

Lock bits are the primary means of protecting the Flash and EEPROM memory from being read or written via external programming interfaces (ISP, JTAG).

Protection Modes (LB2, LB1 bits):

Mode LB2 LB1 Description 1 (unprotected) 1 1 No protection. Memory reading and writing are allowed. 2 (write-protected) 1 0 Writing to Flash and EEPROM via a programmer is forbidden. Reading is allowed. 3 (fully protected) 0 0 Writing and reading of Flash and EEPROM via a programmer are forbidden.

Note: "1" means "unprogrammed", "0" means "programmed".

 

1.2 Boot Lock Bits:

These bits (BLB01, BLB02, BLB11, BLB12) allow setting read or write protection between the application section and the bootloader section. This enables secure firmware updates without the risk of the main application corrupting the bootloader.

 

1.3 Fuse Bits Affecting Security:

Some Fuse bits directly affect the ability to access the microcontroller.

Key Fuse Bits:

Bit Description SPIEN Enables Serial Programming (ISP). If this bit is cleared (programmed to '1'), standard programmers will not be able to access the chip. RSTDISBL Disables the reset function on the RESET pin, turning it into a regular I/O port. This also blocks access via ISP.

 

1.4 Unprotection:

The only way to reset the Lock Bits (LB1/LB2) is to execute a "Chip Erase" command via a programmer. This command completely erases the Flash memory and usually the EEPROM. Afterward, all lock and configuration bits are returned to their default (unprotected) state. The `EESAVE` fuse bit allows preserving the EEPROM data during a chip erase.

 

2. Device Signature:

Atmega microcontrollers have several bytes for identification. Unlike STM32, they do not have a globally unique serial number.

Identification Bytes:

Name Description Signature Bytes Three bytes that uniquely identify the microcontroller model (e.g., 0x1E950F for ATmega328P). They are read by the programmer to verify the device. Calibration Byte A byte for calibrating the internal RC oscillator. It is stored in the signature area.

 

Microchip Technology (AVR)

 

Ask your question: RussianSemiResearch@ya.ru

 

 
RussianSemiResearch. © 2008-2025.E-mail: RussianSemiResearch@ya.ru