7.7.2
Stack Pointer
Name:
SP
Offset:
0x0D
Reset:
Top of stack
Property: -
The CPU.SP holds the Stack Pointer (SP) that points to the top of the stack. After Reset, the Stack
Pointer points to the highest internal SRAM address.
Only the number of bits required to address the available data memory including external memory (up to
64 KB) is implemented for each device. Unused bits will always read as zero.
The CPU.SPL and CPU.SPH register pair represents the 16-bit value, CPU.SP. The low byte [7:0] (suffix
L) is accessible at the original offset. The high byte [15:8] (suffix H) can be accessed at offset + 0x01.
To prevent corruption when updating the SP from software, a write to CPU.SPL will automatically disable
interrupts for the next four instructions or until the next I/O memory write.
Bit
15
Access
R/W
Reset
Bit
7
Access
R/W
Reset
Bits 15:8 – SP[15:8] Stack Pointer High Byte
These bits hold the MSB of the 16-bit register.
Bits 7:0 – SP[7:0] Stack Pointer Low Byte
These bits hold the LSB of the 16-bit register.
©
2018 Microchip Technology Inc.
14
13
R/W
R/W
6
5
R/W
R/W
12
11
SP[15:8]
R/W
R/W
4
3
SP[7:0]
R/W
R/W
Datasheet Preliminary
®
megaAVR
0-Series
AVR CPU
10
9
R/W
R/W
2
1
R/W
R/W
DS40002015A-page 59
8
R/W
0
R/W
Need help?
Do you have a question about the megaAVR 0 Series and is the answer not in the manual?