View previous topic :: View next topic |
Author |
Message |
xpercad Guest
|
Enough stack space |
Posted: Sat Jun 19, 2004 11:17 am |
|
|
Hi Group,
In the August 2002 manual in the Common Questions and Answers section for the What are the restrictions on function calls from an interrupt function ? there is mention that the programmer MUST ensure there will be enough stack space. It also mentions that this can be checked on top of the list file and it should be less than 9.
In the July 2003 manual there is no longer mention concerning this issue (stack less than 9). I am currently working with release 3.180 and PIC18F452 and the list file reads Stack: 9 worst case (7 in main + 2 for interrupts). Is this something I should worry about ???
Thanks in advance,
Aaron |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
Stack Size |
Posted: Sat Jun 19, 2004 12:57 pm |
|
|
According to the MICROCHIP DATA SHEETS, in the 16F series (16F877 for example) the stack size is limited 8.
In the 18F series the stack size is 31, so, in answer to your question, NO a stack depth of 9 on the 18F452 is not a problem.
The message "Stack: 9 worst case (7 in main + 2 for interrupts)" simply gives the greatest possible stack usage scenario and is not meant to imply "worst" in a bad code programming sense. |
|
|
xpercad Guest
|
|
Posted: Mon Jun 21, 2004 7:19 am |
|
|
Thanks a lot dyeatman !!!! |
|
|
|