Hi Gerhard I did the same thing in both my interrupt handlers. (so much from learning from my past mistakes) The low one was easy to spot because when I halted the program it was in the always in the ISR just like you would expect it to be. Now the high level ISR had strange behavior. It appeared to work for the most part but every once in a while the ultoa function would return a value that not that was garbage or out side the range of the value being passed. Every thing else appeared to work just fine. I could not imagine and that there was something wrong with the ultoa function and of course there wasn't. So I reckoned that I had a corrupt stack or had run out of stack space causing the undefined/weird behavior. Phillip Things should be as simple as possible but no simpler Phillip Coiner CTO, GPS Source, Inc. Your source for quality GNSS Networking Solutions and Design Services, Now! -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of Gerhard Fiedler Sent: Wednesday, June 28, 2006 6:40 PM To: piclist@mit.edu Subject: Re: [PIC] C18 resource remaining metric/test Wouter van Ooijen wrote: >> The data sheet says that interrupt flag bits must be cleared in software >> to avoid recursive interrupts. > > are you sure? can you give URL and page? Not exactly recursive interrupts, but successive ones. Many if not most interrupt flags must be cleared in software. No URL and page, but some bit names: EEIF, INT0IF, RBIF, TMR0IF, TMR3IF, ... What happens when you forget to do that (and don't for some reason clear the enable bit) is that your program gets stuck in an infinite loop through the interrupt handler -- and that's the same no matter the language used :) (except possibly for some Basic interpreter that takes care of this behind the scenes). Gerhard -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist