>I suspect I've overrun the software stack in a current project in that local variables sometimes forget what they're holding, causing all kinds of trouble. I'm going to go ahead and increase the space allocated to the stack, but is there some way of detecting this instead of spending hours trying to figure out what's gone wrong? >Harold The hardware stack can generate an interrupt. But you say software stack. So, which software? (After all, software means, "made up" :-) Perhaps this is Mchip's C18 compiler, which I don't use. Or did you just want to detect it? In the outermost loop, push a "sentinel value" onto the stack before anything else goes on. As the loop comes around again, pull the last value off and see if it has changed. If so, something overwrote it. The sentinel value is something recognizable and not likely to be put there by anything else in the program. HTH Barry -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads