English
Language : 

ATMEGA8U2_14 Datasheet, PDF (232/310 Pages) ATMEL Corporation – 125 Powerful Instructions – Most Single Clock Cycle Execution
Figure 23-3. Boot Process Description
HWBE
ATmega8U2/16U2/32U2
RESET
PD7/HWB
tSHRH
tHHRH
Ext. Hardware
Conditions
BOOTRST
Reset Vector = Application Reset
Reset Vector =Boot Lhoader Reset
23.7
Addressing the Flash During Self-Programming
The Z-pointer is used to address the SPM commands. The Z pointer consists of the Z-registers
ZL and ZH in the register file. The number of bits actually used is implementation dependent.
Since the Flash is organized in pages (see Table 25-7 on page 249), the Program Counter can
be treated as having two different sections. One section, consisting of the least significant bits, is
addressing the words within a page, while the most significant bits are addressing the pages.
This is shown in Figure 23-4. Note that the Page Erase and Page Write operations are
addressed independently. Therefore it is of major importance that the Boot Loader software
addresses the same page in both the Page Erase and Page Write operation. Once a program-
ming operation is initiated, the address is latched and the Z-pointer can be used for other
operations.
The (E)LPM instruction use the Z-pointer to store the address. Since this instruction addresses
the Flash byte-by-byte, also bit Z0 of the Z-pointer is used.
7799D–AVR–11/10
232