| |||||
Technical Support Support Resources
Product Information | C51: CALCULATING STACK SIZEQUESTIONHow can I determine the maximum stack size of my program? ANSWERThere is no automatic way the tools can tell you the maximum stack depth or stack utilization. Because of asynchronous events and interrupts, the automation is too difficult. However, you can use the µVision Simulator which provides the sp_max value in the register window. When you execute all features of your application, this gives you the maximum sp value that has been reached by your application. Make sure that your assumptions about the available stack are correct. Some 8051 variants have just 128 bytes on-chip RAM and therefore the stack space ends at 0x7F. You should have more bytes available for executed interrupts. As a guideline, there should be enough space to execute the most complex interrupt of your application. If you cannot use the µVision Simulator, use the following method, which works in any debugging tool. You may use the Monitor, the ISD51 In-system debugger, or any in-circuit emulator. The results should be similar.
SEE ALSO
FORUM THREADSThe following Discussion Forum threads may provide information related to this topic.
Last Reviewed: Monday, May 10, 2004 | ||||
| |||||