Well, the nature of my app is that everything is scheduled, so the main routine is just loop:goto loop. I should only have to worry about nested or recursive calls that might exceed the stack depth, right? 8 certainly isn't much to work with, I agree with that! Fortunately, my ISR just checks the time vs. each thing that might need to be done and calls them if there's a match, one at a time. I pretty much invented my own scheduling routine. Couldn't find zippo on the subject @ Microchip. Suggestions eagerly accepted. -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Olin Lathrop Sent: Thursday, July 05, 2001 1:57 PM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: F877 UART in ISR > What's wrong with using the stack with calls from within an ISR? It's not inherently wrong, but it could be a lurking gotcha. Your main code has a certain call tree, which hopefully requires some finite maximum number of stack locations. If interrupts are enabled everywhere, then the stack location used by the interrupt routine must be left available at all times. If the interrupt routine calls other subroutines, then ALL these additional call stack locations must be left available whenever interrupts are enabled. If your interrupt routine calls one subroutine, then it uses 2 call stack locations. Your processor (16F877) 8 stack locations, so your main code can now use no more than 6. If that's not a problem, then it's OK. But you should be aware of the cost of calling subroutines during an interrupt every time you do it. ******************************************************************** Olin Lathrop, embedded systems consultant in Littleton Massachusetts (978) 742-9014, olin@embedinc.com, http://www.embedinc.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu