Datasheet

Figure 31-3. Addressing the Flash During SPM
PROGRAM MEMORY
0115
Z - REGISTER
BIT
0
ZPAGEMSB
WORD ADDRESS
WITHIN A PAGE
PAGE ADDRESS
WITHIN THE FLASH
ZPCMSB
INSTRUCTION WORD
PAGE
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
PAGE
PCWORDPCPAGE
PCMSB
PAGEMSB
PROGRAM
COUNTER
Note:  The different variables used in this figure are listed in the Related Links.
Related Links
32.6 Page Size
31.8.14 ATmega88PA Boot Loader Parameters
31.8 Self-Programming the Flash
The program memory is updated in a page-by-page fashion. Before programming a page with the data
stored in the temporary page buffer, the page must be erased. The temporary page buffer is filled one
word at a time using SPM and the buffer can be filled either before the page erase command or between
a page erase and a page write operation:
Alternative 1. Fill the Buffer Before a Page Erase
Fill temporary page buffer
Perform a page erase
Perform a page write
Alternative 2. Fill the Buffer After Page Erase
Perform a page erase
Fill temporary page buffer
Perform a page write
ATmega48PA/88PA/168PA
Boot Loader Support – Read-While-Write Self-...
© 2018 Microchip Technology Inc.
Datasheet Complete
DS40002011A-page 352