At 17:00 7/11/99 -0500, you wrote: >Hi Dennis, > >At 08:50 AM 11/8/99 +1100, you wrote: >> >>No, the WDT comes off the XTAL >> >> > >Which chip are you talking about? I believe they are all the same with >respect to the WDT,and the following is quoted from the 16F84 datasheet, >page 50: > >"The Watchdog Timer is a free running on-chip RC >oscillator which does not require any external >components. This RC oscillator is separate from the >RC oscillator of the OSC1/CLKIN pin. That means that >the WDT will run even if the clock on the OSC1/CLKIN >and OSC2/CLKOUT pins of the device has been >stopped, for example, by execution of a SLEEP >instruction." > Yep sorry about that, was thinking of 8605 stuff when I wrote this. I should have twigged when I was thinking about how sloppy it is. >>WDT would not detect brownout unless that brownout condtions:- >>1/ Kept the XTAL runing >>2/ Caused the programme to stop running such that the WDT timer would go off. > >Well, it would not have to do #1 or #2. However, I suppose that it is >possible that a brown-out could cause the WDT's RC oscillator to stop OR >prevent the prescaler/counter from registering its pulses and causing a >reset. SO, it isn't a reliable brown-out detector. > >> >>Remember that in brownout it is unknown what is read and written to ports >>and RAM, there is a chance that the WDT would and could be written correctly >> >> > >Yes > >>>How many times should we have CLRWDT in our code? Your right - >>> only once. Even though I sometimes do it myself, any more than >>>once is asking for trouble. >> >>Yes > >Well, I can see how it is BEST to only place it in your code once (reduce >the chance that the code would lock up by running an infinite loop it isn't >supposed to) ,but not always possible. I could have two loops in my code >that wait for some kind of event or input,and are so tight that they cannot >branch to a separate part of the code to run a CLRWDT. > Bad code Sean, re-organise it to remove this potential problem. Dennis > >Sean > >