Datasheet
340
ATmega16U4/32U4 [DATASHEET]
Atmel-7766J-USB-ATmega16U4/32U4-Datasheet_04/2016
27.5 Entering the Boot Loader Program
The bootloader can be executed with three different conditions:
27.5.1 Regular Application Conditions
A jump or call from the application program. This may be initiated by a trigger such as a command received via
USART, SPI, or USB.
27.5.2 Boot Reset Fuse
The Boot Reset Fuse (BOOTRST) can be programmed so that the Reset Vector is pointing to the Boot Flash
start address after a reset. In this case, the Boot Loader is started after a reset. After the application code is
loaded, the program can start executing the application code. Note that the fuses cannot be changed by the
MCU itself. This means that once the Boot Reset Fuse is programmed, the Reset Vector will always point to the
Boot Loader Reset and the fuse can only be changed through the serial or parallel programming interface.
Note: 1. “1” means unprogrammed, “0” means programmed.
27.5.3 External Hardware conditions
The Hardware Boot Enable Fuse (HWBE) can be programmed (see the table below) so that upon special
hardware conditions under reset, the bootloader execution is forced after reset.
Note: 1. “1” means unprogrammed, “0” means programmed.
When the HWBE fuse is enable the ALE/HWB pin is configured as input during reset and sampled during reset
rising edge. When ALE/HWB
pin is ‘0’ during reset rising edge, the reset vector will be set as the Boot Loader
Reset address and the Boot Loader will be executed (See Figure 27-3).
Table 27-4. Boot Reset Fuse
(1)
BOOTRST Reset Address
1 Reset Vector = Application Reset (address 0x0000)
0 Reset Vector = Boot Loader Reset (see Table 27-8 on page 349)
Table 27-5. Hardware Boot Enable Fuse
(1)
HWBE Reset Address
1 ALE/HWB pin can not be used to force Boot Loader execution after reset
0 ALE/HWB pin is used during reset to force bootloader execution after reset