Datasheet
31. Boot Loader Support – Read-While-Write Self-programming (BTLDR)
31.1 Features
• Read-While-Write Self-Programming
• Flexible Boot Memory Size
• High Security (Separate Boot Lock Bits for a Flexible Protection)
• Separate Fuse to Select Reset Vector
• Optimized Page
(1)
Size
• Code Efficient Algorithm
• Efficient Read-Modify-Write Support
Note: 1. A page is a section in the Flash consisting of several bytes (see Table. No. of Words in a Page
and No. of Pages in the Flash in Page Size) used during programming. The page organization does not
affect normal operation.
31.2 Overview
In this device, the boot loader support provides a real read-while-write self-programming mechanism for
downloading and uploading program code by the MCU itself. This feature allows flexible application
software updates controlled by the MCU using a Flash-resident boot loader program. The boot loader
program can use any available data interface and associated protocol to read code and write (program)
that code into the Flash memory, or read the code from the program memory. The program code within
the boot loader section has the capability to write into the entire Flash, including the boot loader memory.
The boot loader can thus even modify itself, and it can also erase itself from the code if the feature is not
needed anymore. The size of the boot loader memory is configurable with fuses and the boot loader has
two separate sets of boot lock bits, which can be set independently. This gives the user a unique flexibility
to select different levels of protection.
31.3 Application and Boot Loader Flash Sections
The Flash memory is organized into two main sections; the application section and the boot loader
section. The size of the different sections is configured by the BOOTSZ fuses. These two sections can
have different level of protection since they have different sets of Lock bits.
31.3.1 Application Section
The application section is the section of the Flash that is used for storing the application code. The
protection level for the application section can be selected by the application boot lock bits (Boot Lock bits
0). The application section can never store any boot loader code since the SPM instruction is disabled
when executed from the application section.
31.3.2 Boot Loader Section (BLS)
While the application section is used for storing the application code, the boot loader software must be
located in the Boot Loader Section (BLS) since the SPM instruction can initiate a programming when
executing from the BLS only. The SPM instruction can access the entire Flash, including the BLS itself.
The protection level for the BLS can be selected by the Boot Loader Lock bits (Boot Lock bits 1).
ATmega48PA/88PA/168PA
Boot Loader Support – Read-While-Write Self-...
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40002011A-page 346