beautypg.com

Memory programming, Boot loader support, Atmega161(l) – Rainbow Electronics ATmega161L User Manual

Page 110

background image

110

ATmega161(L)

1228C–AVR–08/02

Memory
Programming

Boot Loader Support

The ATmega161 provides a 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 ATmega161 Flash memory is organized in two main sections:

1. The Application Code section (address $0000 - $1DFF)

2. The Boot Loader section/Boot block (address $1E00 - $1FFF)

Figure 74. Memory Sections

The Boot Loader program can use any available data interface and associated protocol,
such as UART serial bus interface, to input or output program code and write (program)
that code into the Flash memory or read the code from the Program memory.

The program Flash memory is divided into pages that each contain 128 bytes. The Boot
Loader Flash section occupies eight pages from $1E00 to $1FFF by 16-bit words.

The Store Program Memory (SPM) instruction can access the entire Flash, but it can
only be executed from the Boot Loader Flash section. If no Boot Loader capability is
needed, the entire Flash is available for application code. The ATmega161 has two sep-
arate sets of Boot Lock bits that can be set independently. This gives the user a unique
flexibility to select different levels of protection. The user can elect to:

$0000

$1FFF

Program Memory

Application Code section

(7.5K x 16)

$1E00

$1DFF

Boot Loader section

(512 x 16)