Datasheet
ATmega164A/PA/324A/PA/644A/PA/1284/P
2018 Microchip Technology Inc. Data Sheet Complete DS40002070A-page 23
7.5.1 SPH and SPL – Stack Pointer High and Stack pointer Low
Note: 1. Initial values respectively for the ATmega164A/164PA/324A/324PA/644A/644PA/1284/1284P.
7.5.2 RAMPZ – Extended Z-pointer Register for ELPM/SPM
(1)
For ELPM/SPM instructions, the Z-pointer is a concatenation of RAMPZ, ZH, and ZL, as shown in Figure 7-4 on
page 23. Note that LPM is not affected by the RAMPZ setting.
Figure 7-4. The Z-pointer used by ELPM and SPM.
The actual number of bits is implementation dependent. Unused bits in an implementation will always read as
zero. For compatibility with future devices, be sure to write these bits to zero.
Note: 1. RAMPZ is only valid for ATmega1284/ATmega1284P.
7.6 Instruction Execution Timing
This section describes the general access timing concepts for instruction execution. The AVR CPU is driven by
the CPU clock clk
CPU
, directly generated from the selected clock source for the chip. No internal clock division is
used.
Figure 7-5 on page 24 shows the parallel instruction fetches and instruction executions enabled by the Harvard
architecture and the fast-access Register File concept. This is the basic pipelining concept to obtain up to 1
MIPS per MHz with the corresponding unique results for functions per cost, functions per clocks, and functions
per power-unit.
Bit 151413121110 9 8
0x3E (0x5E)
– – – SP12 SP11 SP10 SP9 SP8 SPH
0x3D (0x5D) SP7 SP6 SP5 SP4 SP3 SP2 SP1 SP0 SPL
76543210
Read/Write R R R R/W R/W R/W R/W R/W
R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 0 0 0 0/0
(1)
0/1
(1)
1/0
(1)
00
11111111
Table 7-2. Stack Pointer size
Device Stack Pointer size
ATmega164A/ATmega164PA SP[10:0]
ATmega324A/ATmega324PA SP[11:0]
ATmega644A/ATmega644PA SP[12:0]
ATmega1284/ATmega1284P SP[13:0]
Bit 765432 1 0
0x3B (0x5B)
RAMPZ7 RAMPZ6 RAMPZ5 RAMPZ4 RAMPZ3 RAMPZ2 RAMPZ1 RAMPZ0
RAMPZ
Read/Write R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value000000 0 0
Bit (Individually) 7 0 7 0 7 0
RAMPZ ZH ZL
Bit (Z-pointer) 23 16 15 8 7 0