In a normally programmed and operating cpu the instruction execution order is well defined and known at all times, together with the time it takes each segment of code to run. Should something go wrong (glitch etc) then this order will be changed, and with it the timing. A watchdog circuit is a hardware timer that runs down continuously, regardless of what the cpu is doing, with the exception of a clrwdt instruction or resetting the watchdog prescaler. If the timer runs down completely it causes a reset of the cpu and that should allow the cpu to be reset to a valid state. The amount of time the watchdog takes to run down is fixed (but settable by the user on a pic). So a watchdog timer reset (clrwdt) is best placed in the user's code in a location where it is executed regularly, with a period just smaller than the timeout of the watchdog, while the program is running correctly, but not if its not. Since there is no way to know where the 'right' location is beforehead, clrwdt should be put in a location that has a low probability to execute if the code does not work right. This would be a program segment that is crucial to the function of the code. It is difficult to determine a general case, the best location depends on the application. Sometimes more than one clrwdt is used, depending on execution paths. In any case use as few as possible, this reduces the likelihood of their being executed when the cpu is operating randomly. Peter -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics