> David C Brown wrote 2014-01-08 14:48: >> The return stack on the mid range PICs is limited to 8 levels. Whilst t= his >> is generally adequate it is difficult to keep track of the call depth. = Is >> there any tool for examining a program for maximum call depth? >> I know the XC8 compiler does create a file listing the maximum stack depths achieved by each function (including main()). Look for ../dist/XC8/.production.map (generated by the linker). Towards the middle it starts listing details about the various function used in the program including what stack depth they require. FUNCTION INFORMATION: *************** function _main ***************** Defined at: line 249 in file "main.c" Parameters: Size Location Type None Auto vars: Size Location Type c 1 68[BANK0 ] unsigned char Return value: Size Location Type None void Registers used: wreg, fsr0l, fsr0h, fsr1l, fsr1h, status,2, status,0, pclath, cstac= k Tracked objects: On entry : On exit : Unchanged: Data sizes: COMMON BANK0 BANK1 BANK2 Params: 0 0 0 0 Locals: 0 1 0 0 Temps: 0 1 0 0 Totals: 0 2 0 0 Total ram usage: 2 bytes Hardware stack levels required when called: 8 <- ** This is what your looking for ** This function calls: _getch _print_time _printf _set_time _print_logging_rate _set_logging_rate _print_temperature _start_logging_temperature _ConfigureOscillator _InitApp This function is called by: Startup code after reset This function uses a non-reentrant model --=20 Jason White --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .