On Mon, Dec 14, 1998 at 1:55 PM, Clyde wrote: > On Mon, Dec 14, 1998 at 02:03:55PM -0800, Michael J. Ghormley wrote: > > If I have inadvertatly allowed an INT on PortB or something, at > least it has a > > minimal effect. I have always thought that this is a good idea. > > IMHO I think it's not such a good idea. What I would rather do is place > some code at the interrupt vector location that did something noticeable > then hung, e.g. sit in a tight loop toggling an output pin. I agree with Clyde, this is another standard "good practice" for embedded system developers, regardless of the processor. The toggle-pin-til-watchdog trick is also common for capturing fatal initialization errors, thus allowing the developer to first test the debug pin if there's a system that's reseting constantly or sporadically. I tend to avoid this in the PIC because I usually don't have a pin (or sometimes the few words of codespace) available. Instead, my startup code stores the reason for reset into a byte of RAM for later use, if I want it. If it's anything other than a regular power-up, the reset reason gets spewed to the serial port, LCD, or even temporarily to the LED display (if there is one). This way watchdog timeouts, brown-outs, and unexpected interrupts are all captured and dealt with the same way. > Basically the philosophy is that there is no such thing as a small error > in an embedded system I also go by this philosophy, as should anyone developing commercial products (personal Christmas presents exempt). Ignoring things like unexpected interrupts is often the equivalent to ignoring tips of icebergs. -Ed V. Agile Controls evan@direct.ca * Want to leave the piclist? See http://persweb.direct.ca/evan/pic/piclist.htm *