And he worst part of that is that it can easily happen to only "break" once every so many minutes, hours, days, etc... Not that I've ever made that mistake myself but that sort of very intermittent bug is hell to find. Ok, ok, I did it... and it ended up looking like a hardware bug and the hardware guys spent weeks on it before I noticed the problem (software development was on-going) and corrected it quietly... One of the guys in the hardware group co-incidentally replaced a component (for like the 3rd time??) and "that fixed it... wow! 3 bad ... who would have thought?" I figure it makes up for all the times I've been screwed by hardware people not feeding me the signal they say they are or building glitchy power supplies or .... --- James Newton, Admin #3 mailto:jamesnewton@piclist.com 1-619-652-0593 VM 1-208-279-8767 FAX PIC/PICList FAQ: http://www.piclist.com or .org -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Olin Lathrop Sent: Thursday, September 13, 2001 12:16 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [PIC]: The neverending interrupt... > My reasoning was, I'm not using STATUS in the main part of the code so why > save it? I imagine it's possible that the page bit would somehow be set and > thus my code would try to be working on the wrong page so I added a bcf > instruction to make sure I'm in the right page. But...if you insist...I'll > save STATUS. Unless you've got an extremely simple forground loop, it will use STATUS. Personally, I would always write a "clean" interrupt routine that doesn't trash any state unless it was absolutely imperative not to spend the cycles or the code space, AND it was clearly documented in all the appropriate places. Otherwise, sooner or later you or someone else will make an innocent little change that causes everything to break just because it happened to use a condition bit in STATUS or whatever. A well behaved interrupt routine is simply good programming practise. ******************************************************************** 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