> > I, too, use the PIC WDT always, and disable the interrupts > > infrequently. The only place that clears the WDT (CLRWDT) is in the > > timer interrupt, which occurs in less than 15mS intervals. > > > > But some HLLs require that the WDT not be used. How will you recover a > > locked PIC? An external WDT is the best idea. Of course, there are > > SOT23 chips that do this... > > > Bob, > Is it a good idea to refresh the wdt in a timer interrupt? > I'm thinking that if the code locks up (program mainline) then the > timer interrupt will still be working & the wdt keeps getting > refreshed. I've tended to put wdt refreshes in the main code (= some > sort of regular loop) to avoid this. A trick I've used once before is set a location in RAM to a known value, eg. 0xAA, and invert it in the ISR. This way in just one place in your program you can reset the WDT being satisifed that BOTH the mainline code and ISR are looping as they should. -- Brent Brown, Electronic Design Solutions 16 English Street, St Andrews, Hamilton 3200, New Zealand Ph: +64 7 849 0069 Fax: +64 7 849 0071 Cell: +64 27 433 4069 eMail: brent.brown@clear.net.nz -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist