attiny261a-xu ATMEL Corporation, attiny261a-xu Datasheet - Page 11

no-image

attiny261a-xu

Manufacturer Part Number
attiny261a-xu
Description
8-bit Avr Microcontroller With 2/4/8k Bytes In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
attiny261a-xuR
Manufacturer:
Atmel
Quantity:
5 990
4.5
8197B–AVR–01/10
Stack Pointer
Figure 4-3.
In different addressing modes these address registers function as automatic increment and
automatic decrement (see the instruction set reference for details).
The Stack is mainly used for storing temporary data, local variables and return addresses for
interrupts and subroutine calls. The Stack Pointer Register always points to the top of the Stack,
in the data SRAM Stack area where the subroutine and interrupt stacks are located.
The Stack 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 start of the
SRAM (see
internal SRAM.
Note that the Stack is implemented as growing from higher to lower memory locations. This
means a Stack PUSH command decreases the Stack Pointer. See
Table 4-1.
The AVR Stack Pointer is implemented as two 8-bit registers in the I/O space. The number of
bits actually used is implementation dependent.
Note that the data space in some implementations of the AVR architecture is so small that only
SPL is needed. In this case, the SPH Register will not be present.
X-register
Y-register
Z-register
Instruction
PUSH
CALL
ICALL
RCALL
POP
RET
RETI
Figure 5-2 on page
The X-, Y-, and Z-registers
Stack Pointer instructions
Stack pointer
Decremented by 1
Decremented by 2
Incremented by 1
Incremented by 2
15
7
R27 (0x1B)
15
7
R29 (0x1D)
15
7
R31 (0x1F)
16). The initial Stack Pointer value equals the last address of the
ZH
XH
YH
0
Description
Data is pushed onto the stack
Return address is pushed onto the stack with a
subroutine call or interrupt
Data is popped from the stack
Return address is popped from the stack with return
from subroutine or return from interrupt
0
0
7
R26 (0x1A)
7
R28 (0x1C)
7
R30 (0x1E)
Table
4-1.
XL
YL
ZL
0
11
0
0
0
0
0

Related parts for attiny261a-xu