ATTIny13-12PI ATMEL Corporation, ATTIny13-12PI Datasheet - Page 96

no-image

ATTIny13-12PI

Manufacturer Part Number
ATTIny13-12PI
Description
8-bit AVR Microcontroller with 1K Bytes In-System Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
Addressing the Flash
During Self-
Programming
96
ATtiny13
The Z-pointer is used to address the SPM commands.
Since the Flash is organized in pages (see Table 46 on page 102), the Program Counter
can be treated as having two different sections. One section, consisting of the least sig-
nificant bits, is addressing the words within a page, while the most significant bits are
addressing the pages. This is shown in Figure 52. Note that the Page Erase and Page
Write operations are addressed independently. Therefore it is of major importance that
the software addresses the same page in both the Page Erase and Page Write
operation.
The LPM instruction uses 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 52. Addressing the Flash During SPM
Note:
Bit
ZH (R31)
ZL (R30)
Z - REGISTER
PROGRAM MEMORY
1. The different variables used in Figure 52 are listed in Table 46 on page 102.
BIT
PAGE
PROGRAM
COUNTER
15
Z15
Z7
15
7
PAGE ADDRESS
WITHIN THE FLASH
ZPCMSB
PCMSB
Z14
Z6
14
6
PCPAGE
Z13
Z5
13
5
ZPAGEMSB
PAGEMSB
PCWORD
Z12
12
Z4
4
WORD ADDRESS
WITHIN A PAGE
(1)
1
Z11
11
Z3
0
0
3
INSTRUCTION WORD
PAGE
Z10
10
Z2
2
Z9
Z1
9
1
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
2535B–AVR–01/04
Z8
Z0
8
0

Related parts for ATTIny13-12PI