beautypg.com

Entering the boot loader program, Atmega161(l) – Rainbow Electronics ATmega161L User Manual

Page 111

background image

111

ATmega161(L)

1228C–AVR–08/02

• Protect the entire Flash from a software update by the Boot Loader program

• Only protect the Boot Loader section from a software update by the Boot Loader

program

• Only protect the Application Code section from a software update by the Boot Loader

program

• Allow software update in the entire Flash

See Table 37 and Table 38 for further details. The Boot Lock bits can be set in software
and in Serial or Parallel Programming mode, but they can only be cleared by a Chip
Erase command.

Note:

1. “1” = unprogrammed, “0” = programmed

Note:

1. “1” means unprogrammed, “0” means programmed

Entering the Boot Loader
Program

Entering the Boot Loader takes place by a jump or call from the application program.
This may be initiated by some trigger such as a command received via UART or SPI
interface. Alternatively, the Boot Reset Fuse (BOOTRST) can be programmed so that
the Reset Vector is pointing to address $1E00 after a reset. In this case, the Boot
Loader is started after the 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. The BOOTRST fuse can also be locked by pro-
gramming LB1. When LB1 is programmed it is not possible to change the BOOTRST
fuse unless a Chip Erase command is performed first.

Table 37. Boot Lock Bit0 Protection Modes (Application Code Section)

(1)

BLB0 Mode

BLB02

BLB01

Protection

1

1

1

No restrictions for SPM, LPM accessing Application Code
section

2

1

0

SPM is not allowed to write to the Application Code
section.

3

0

0

SPM is not allowed to write to the Application Code
section, and LPM executing from the Boot Loader section
is not allowed to read from the Application Code section.

4

0

1

LPM executing from the Boot Loader section is not
allowed to read from the Application Code section.

Table 38. Boot Lock Bit1 Protection Modes (Boot Loader Section)

(1)

BLB1 Mode

BLB12

BLB11

Protection

1

1

1

No restrictions for SPM, LPM accessing Boot Loader
section

2

1

0

SPM is not allowed to write to the Boot Loader section.

3

0

0

SPM is not allowed to write to the Boot Loader section,
and LPM executing from the Application Code section is
not allowed to read from the Boot Loader section.

4

0

1

LPM executing from the Application Code section is not
allowed to read from the Boot Loader section.