> Van: Daniel Watford > Aan: PICLIST@MITVMA.MIT.EDU > Onderwerp: Re: Newbie code doesn't seem to work - please take a look > Datum: donderdag 8 juli 1999 12:05 > > Hi again, Hello Daniel, > I've checked the watchdog timer, and indeed it was enabled. > I've now disabled it and the circuit is working perfectly. > What does the watchdog time do exactly? Wachdog-timers are invented to mess-up programs of Newbies. Really ! :-) Ah, well. Id see you don't beleive me. O.k. Another explanation of their existence: It is possible that a controller will get stuck in some kind of loop, due to bad programming (go kick the programmer :-) or due to power spikes and the like. When this happens, the circuit has to be reset to enable it to work again. So, the first controllers where build wid a LED attached, that blinked when all was well. If it stopped blinking, someone had to press the RESET button. After a while someone build a "missing puls" detector (a retriggerable mono-flop) and connected that to the blinking led and the RESET button. Now, whenever the led stopped blinking, the mono-flop would time-out, and reset the system. No human needed anymore ! Later they decided to build the mono-flop into the system. That feature is now known as a "WachDog". It will simply count pulses (from and independend internal source). If the WachDog-counter overflows it will either Reset the controller (or generate a Interrupt, depended on how it's configured). The blinking LED was replaced by an Instruction to re-set the WachDog (CLRWDT -> Clear WachDog Timer). So, when a WachDog is enabled and not re-set every once-in-a-while, it will eventually reset the controller, creating strange effects for unsuspecting Newbies .... (Sorry, could not let this one go ... :-) Greetz, Rudy Wieser