ATMEGA2561V ATMEL [ATMEL Corporation], ATMEGA2561V Datasheet - Page 14

no-image

ATMEGA2561V

Manufacturer Part Number
ATMEGA2561V
Description
8-bit Microcontroller with 64K/128K/256K Bytes In-System Programmable Flash
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATMEGA2561V-8AI
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA2561V-8AU
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA2561V-8AU
Manufacturer:
ALTERA
0
Part Number:
ATMEGA2561V-8AU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATMEGA2561V-8AUR
Manufacturer:
Atmel
Quantity:
10 000
Part Number:
ATMEGA2561V-8MI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATMEGA2561V-8MU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
The X-register, Y-register, and
Z-register
Stack Pointer
14
ATmega640/1280/1281/2560/2561
The registers R26..R31 have some added functions to their general purpose usage.
These registers are 16-bit address pointers for indirect addressing of the data space.
The three indirect address registers X, Y, and Z are defined as described in Figure 7.
Figure 7. The X-, Y-, and Z-registers
In the different addressing modes these address registers have functions as fixed dis-
placement, automatic increment, and automatic decrement (see the instruction set
reference 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 Regis-
ter 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 command decreases the Stack Pointer.
The Stack Pointer points to the data SRAM Stack area where the Subroutine and Inter-
rupt 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 0x0200. The initial value of the stack pointer is the
last address of the internal SRAM. The Stack Pointer is decremented by one when data
is pushed onto the Stack with the PUSH instruction, and it is decremented by two for
ATmega640/1280/1281 and three for ATmega2560/2561 when the return address is
pushed onto the Stack with subroutine call or interrupt. The Stack Pointer is incre-
mented by one when data is popped from the Stack with the POP instruction, and it is
incremented by two for ATmega640/1280/1281 and three for ATmega2560/2561 when
data is popped from the Stack with return from subroutine RET or return from interrupt
RETI.
The AVR Stack Pointer is implemented as two 8-bit registers in the I/O space. The num-
ber 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
Bit
0x3E (0x5E)
0x3D (0x5D)
Read/Write
Initial Value
SP15
SP7
R/W
R/W
15
7
0
1
15
7
R27 (0x1B)
15
7
R29 (0x1D)
15
7
R31 (0x1F)
SP14
SP6
R/W
R/W
14
6
0
1
SP13
SP5
R/W
R/W
13
5
1
1
XH
YH
ZH
0
SP12
SP4
R/W
R/W
12
4
0
1
SP11
SP3
R/W
R/W
11
3
0
1
0
0
7
R26 (0x1A)
7
R28 (0x1C)
7
R30 (0x1E)
SP10
R/W
R/W
SP2
10
2
0
1
R/W
R/W
SP9
SP1
9
1
0
1
XL
YL
ZL
0
R/W
R/W
SP8
SP0
2549K–AVR–01/07
8
0
1
1
SPH
SPL
0
0
0
0
0

Related parts for ATMEGA2561V