ATTIny2313-16MI ATMEL Corporation, ATTIny2313-16MI Datasheet - Page 155

no-image

ATTIny2313-16MI

Manufacturer Part Number
ATTIny2313-16MI
Description
8-bit AVR Microcontroller with 2K Bytes In-System Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
Addressing the Flash
During Self-
Programming
2543C–AVR–12/03
The Z-pointer is used to address the SPM commands.
Since the Flash is organized in pages (see Table 74 on page 163), 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 67. 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 67. Addressing the Flash During SPM
Note:
Bit
ZH (R31)
ZL (R30)
Z - REGISTER
PROGRAM MEMORY
1. The different variables used in Figure 67 are listed in Table 74 on page 163.
BIT
PAGE
PROGRAM
COUNTER
15
Z15
15
Z7
7
PAGE ADDRESS
WITHIN THE FLASH
ZPCMSB
PCMSB
Z14
14
Z6
6
PCPAGE
Z13
Z5
13
5
ZPAGEMSB
PAGEMSB
PCWORD
Z12
Z4
12
4
WORD ADDRESS
WITHIN A PAGE
(1)
1
Z11
11
Z3
3
0
0
INSTRUCTION WORD
PAGE
Z10
10
Z2
2
ATtiny2313/V
Z9
Z1
9
1
PCWORD[PAGEMSB:0]:
00
01
02
PAGEEND
Z8
Z0
8
0
155

Related parts for ATTIny2313-16MI