st72324bk STMicroelectronics, st72324bk Datasheet - Page 24

no-image

st72324bk

Manufacturer Part Number
st72324bk
Description
3 V/5 V Range 8-bit Mcu With 4/8 Kbyte Rom, 10-bit Adc, Four Timers And Spi
Manufacturer
STMicroelectronics
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
st72324bk6
Manufacturer:
ST
0
Part Number:
st72324bk6/MFNTR
Manufacturer:
ST
0
Part Number:
st72324bk6TA
Manufacturer:
FREESCALE
Quantity:
201
Part Number:
st72324bk6TA
Manufacturer:
ST
0
Central processing unit
4.3.5
Reset:
Note:
24/167
15
0
0
Stack pointer (SP)
The Stack Pointer is a 16-bit register which is always pointing to the next free location in the
stack. It is then decremented after data has been pushed onto the stack and incremented
before data is popped from the stack (see
Since the stack is 256 bytes deep, the 8 most significant bits are forced by hardware.
Following an MCU Reset, or after a Reset Stack Pointer instruction (RSP), the Stack Pointer
contains its reset value (the SP7 to SP0 bits are set) which is the stack higher address.
The least significant byte of the Stack Pointer (called S) can be directly accessed by a LD
instruction.
When the lower limit is exceeded, the Stack Pointer wraps around to the stack upper limit,
without indicating the stack overflow. The previously stored information is then overwritten
and therefore lost. The stack also wraps in case of an underflow.
The stack is used to save the return address during a subroutine call and the CPU context
during an interrupt. The user may also directly manipulate the stack by means of the PUSH
and POP instructions. In the case of an interrupt, the PCL is stored at the first location
pointed to by the SP. Then the other registers are stored in the next locations as shown in
Figure
A subroutine call occupies two locations and an interrupt five locations in the stack area.
Figure 9.
0
When an interrupt is received, the SP is decremented and the context is pushed on the
stack.
On return from interrupt, the SP is incremented and the context is popped from the
stack.
@ 0100h
@ 01FFh
01 FFh
SP
9.
0
Subroutine
Stack Higher Address = 01FFh
Stack Lower Address = 0100h
Stack manipulation example
CALL
PCH
PCL
0
SP
0
Interrupt
Event
PCH
PCH
PCL
PCL
CC
A
X
0
Read/Write
SP
8
1
PUSH Y
SP7
PCH
PCH
PCL
PCL
CC
7
Figure
Y
A
X
SP6
SP
9).
SP5
POP Y
PCH
PCH
PCL
PCL
CC
A
X
SP4
SP
SP3
IRET
PCH
PCL
ST72323 ST72323L
SP2
SP
or RSP
SP1
RET
SP0
0

Related parts for st72324bk