ATmega88PA Automotive Atmel Corporation, ATmega88PA Automotive Datasheet - Page 11

no-image

ATmega88PA Automotive

Manufacturer Part Number
ATmega88PA Automotive
Description
Manufacturer
Atmel Corporation
5.6
5.6.1
7701E–AVR–02/11
Stack Pointer
SPH and SPL – Stack Pointer High and Low
Figure 5-3.
In the different addressing modes, these address registers have functions as fixed displace-
ment, automatic increment, and automatic decrement (see the instruction set summary for
details).
The stack is mainly used for storing temporary data, for storing local variables, and for storing
return addresses after interrupts and subroutine calls. The stack pointer register always points
to the top of the stack. Note that the stack is implemented as growing from higher memory
locations to lower memory locations. This implies that a stack PUSH instruction decreases the
stack pointer.
The stack pointer points to the data SRAM stack area where the subroutine and interrupt
stacks are located. This stack space in the data SRAM must be defined by the program before
any subroutine calls are executed or interrupts are enabled. The stack pointer must be set to
point above 0x60. The stack pointer is decremented by one when data are pushed onto the
stack with the PUSH instruction, and it is decremented by two when the return address is
pushed onto the stack with a subroutine call or interrupt. The stack pointer is incremented by
one when data are popped from the stack with the POP instruction, and it is incremented by
two when data are popped from the stack with a return from subroutine RET instruction or
return from interrupt RETI instruction.
The Atmel AVR
number of bits actually used is implementation dependent. Note that the data space in some
implementations of the AVR
this case, the SPH register will not be present.
X-register
Y-register
Z-register
Bit
0x3E (0x5E)
0x3D (0x5D)
Read/Write
Initial Value
The X-, Y-, and Z-registers
SP15
®
SP7
R/W
R/W
15
7
0
0
stack pointer is implemented as two 8-bit registers in the I/O space. The
15
7
R27 (0x1B)
15
7
R29 (0x1D)
15
7
R31 (0x1F)
SP14
SP6
R/W
R/W
14
6
0
0
Atmel ATtiny24/44/84 [Preliminary]
®
architecture is so small that only the SPL register is needed. In
SP13
SP5
R/W
R/W
13
5
0
0
XH
YH
ZH
0
SP12
SP4
R/W
R/W
12
4
0
0
SP11
SP3
R/W
R/W
11
3
0
0
0
0
7
R26 (0x1A)
7
R28 (0x1C)
7
R30 (0x1E)
SP10
SP2
R/W
R/W
10
2
0
0
SP9
SP1
R/W
R/W
9
1
0
0
XL
YL
ZL
0
SP8
SP0
R/W
R/W
8
0
0
0
SPH
SPL
11
0
0
0
0
0

Related parts for ATmega88PA Automotive