Datasheet
220
ATtiny828 [DATASHEET]
8371A–AVR–08/12
Figure 92. Addressing the Flash During SPM
Variables used in Figure 92 are explained in Table 83, below.
Table 83. Variables Used in Flash Addressing
Note that the Page Erase and Page Write operations are addressed independently. Therefore, it is very important that
the boot loader addresses the same page in both Page Erase and Page Write operations.
Variable Description
PCPAGE
Program Counter page address. Selects page of words and is used with Page Erase and Page
Write operations. See Table 94 on page 232
PCMSB The most significant bit of the Program Counter. See Table 94 on page 232
ZPCMSB
The bit in the Z register that is mapped to PCMSB. Because Z[0] is not used, ZPCMSB =
PCMSB + 1. Z register bits above ZPCMSB are ignored
PCWORD
Program Counter word address. Selects the word within a page. This is used for filling the
temporary buffer and must be zero during page write operations. See Table 94 on page 232
PAGEMSB The most significant bit used to address the word within one page
ZPAGEMSB
The bit in the Z register that is mapped to PAGEMSB. Because Z[0] is not used, ZPAGEMSB =
PAGEMSB + 1
PROGRAM MEMORY
0115
Z - REGISTER
BIT
0
ZPAGEMSB
WORD ADDRESS
WITHIN A PAGE
PAGE ADDRESS
WITHIN THE FLASH
ZPCMSB
INSTRUCTION WORD
PAG E
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
PAG E
PCWORDPCPAGE
PCMSB
PAGEMSB
PROGRAM
COUNTER