ATmega325PA Atmel Corporation, ATmega325PA Datasheet - Page 272

no-image

ATmega325PA

Manufacturer Part Number
ATmega325PA
Description
Manufacturer
Atmel Corporation
Datasheets

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATmega325PA-AU
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATmega325PA-AUR
Manufacturer:
Atmel
Quantity:
10 000
26.7
8285D–AVR–06/11
Addressing the Flash During Self-Programming
ATmega165A/PA/325A/PA/3250A/PA/645A/P/6450A/P
The Z-pointer is used to address the SPM commands.
Since the Flash is organized in pages (see
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
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 only SPM operation that does not use the Z-pointer is Setting the Boot Loader Lock bits.
The content of the Z-pointer is ignored and will have no effect on the operation. The LPM
instruction does also use the Z-pointer to store the address. Since this instruction addresses the
Flash byte-by-byte, also the LSB (bit Z0) of the Z-pointer is used.
Figure 26-3. Addressing the Flash During SPM
Note:
Bit
ZH (R31)
ZL (R30)
Z - REGISTER
1. The different variables used in
2. PCPAGE and PCWORD are listed in
PROGRAM MEMORY
BIT
PAGE
PROGRAM
COUNTER
15
Z15
15
Z7
7
Figure
PAGE ADDRESS
WITHIN THE FLASH
ZPCMSB
PCMSB
Z14
14
Z6
26-3. Note that the Page Erase and Page Write operations are
6
PCPAGE
Z13
Z5
13
5
Figure 26-3
ZPAGEMSB
PAGEMSB
Table 27-7 on page
PCWORD
Z12
Z4
12
Table 27-7 on page
4
WORD ADDRESS
WITHIN A PAGE
(1)
are listed in
1
Z11
0
0
11
Z3
3
INSTRUCTION WORD
PAGE
Table 26-8 on page
Z10
10
Z2
286.
2
286), the Program Counter can
Z9
Z1
9
1
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
279.
Z8
Z0
8
0
272

Related parts for ATmega325PA