English
Language : 

SDA6000 Datasheet, PDF (81/380 Pages) Infineon Technologies AG – Teletext Decoder with Embedded 16-bit Controller
SDA 6000
C16X Microcontroller
stack may have been overwritten by the status information stacked upon the stack
overflow trap service.
• Automatic system stack flushing allows the use of the system stack as a “Stack
Cache” for a bigger external user stack. In this case the STKOV register should be
initialized to a value which represents the desired lowest Top of Stack address plus
12 according to the selected maximum stack size. This takes into consideration the
worst case that could occur, when a stack overflow condition is only detected during
entry into an interrupt service routine. Then, six additional stack word locations are
required to push IP, PSW, and CSP for both the interrupt service routine and the
hardware trap service routine.
The Stack Underflow Pointer STKUN
This non-bit addressable register is compared against the SP register after each
operation, which pops data from the system stack (e.g. POP and RET instructions) and
after each addition to the SP register. If the content of the SP register is greater than the
content of the STKUN register, a stack underflow hardware trap will occur.
Since the least significant bit of register STKUN is tied to ‘0’ and bits 15 through 12 are
tied to ‘1’ by hardware, the STKUN register can only contain values from F000H to
FFFEH.
STKUN
Reset Value: FC00H
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1
1
1
1
stkun
0
rrrr
rw
r
Bit
stkun
Function
Modifiable portion of register STKUN
Specifies the upper limit of the internal system stack.
The Stack Underflow Trap (entered when (SP) > (STKUN)) may be used in two different
ways:
• Fatal error indication treats the stack underflow as a system error through the
associated trap service routine.
• Automatic system stack refilling allows the use of the system stack as a “Stack
Cache” for a bigger external user stack. In this case the STKUN register should be
initialized to a value which represents the desired highest Bottom of Stack address.
Scope of Stack Limit Control
The stack limit control, realized by the register pair STKOV and STKUN, detects cases
where the stack pointer SP is moved outside the defined stack area either by ADD or
Users Manual
4 - 48
2000-06-15