Forums

Watchdog that should be taken out and shot

Started by Tom Lucas September 13, 2006
On 13 Sep 2006 08:44:58 -0700, "larwe" <zwsdotcom@gmail.com> wrote:

> >Tom Lucas wrote: > >> 2) Write 0x1984 to the watchdog RST register to seed the counter. >> (Goodness knows why they chose that value) >
<snip> Big Brother is watch(dogg)ing you!
"Peter Dickerson" <first{dot}surname@tesco.net> wrote in message 
news:5aXNg.17075$SH2.4122@newsfe4-gui.ntli.net...
> "Tom Lucas" <news@REMOVE_auto_THIS_flame_TO_REPLY.clara.co.uk> wrote in > message news:1158161579.6562.0@proxy00.news.clara.net... >> I've been trying to implement the watchdog timer on my Sharp79524 and it >> appears that the mutt is sleeping on the job! > > I'm using a 75410, which has a watchdog that looks the same. I don't use > it > because it is only any use in faulty software and if I had faulty software > why would I expect the watchdog code to be any better. However, I can test > it out.
I fear you're missing the point of a watchdog. A watchdog isn't there to catch faulty software - as you say, you shouldn't have any. (Although some would disagree). It's there as an EMI-recovery device. *Any* microprocessor-based product, no matter how well designed, can be made to go "off in the weeds" with a strong enough EMI spike. The watchdog is there to limit the time the processor can stay off in the weeds. Steve http://www.fivetrees.com
"Steve at fivetrees" <steve@NOSPAMTAfivetrees.com> wrote in message
news:VcSdnRx_c7j92pXYnZ2dnUVZ8qGdnZ2d@pipex.net...
> "Peter Dickerson" <first{dot}surname@tesco.net> wrote in message > news:5aXNg.17075$SH2.4122@newsfe4-gui.ntli.net... > > "Tom Lucas" <news@REMOVE_auto_THIS_flame_TO_REPLY.clara.co.uk> wrote in > > message news:1158161579.6562.0@proxy00.news.clara.net... > >> I've been trying to implement the watchdog timer on my Sharp79524 and
it
> >> appears that the mutt is sleeping on the job! > > > > I'm using a 75410, which has a watchdog that looks the same. I don't use > > it > > because it is only any use in faulty software and if I had faulty
software
> > why would I expect the watchdog code to be any better. However, I can
test
> > it out. > > I fear you're missing the point of a watchdog. > > A watchdog isn't there to catch faulty software - as you say, you
shouldn't
> have any. (Although some would disagree). It's there as an EMI-recovery > device. *Any* microprocessor-based product, no matter how well designed,
can
> be made to go "off in the weeds" with a strong enough EMI spike. The > watchdog is there to limit the time the processor can stay off in the
weeds. After such a spike the last thing I would worry about is the CPU. That would system appear to be working but not actually be. Internal and external EMI are a big issue for the delicate measurements. In any case my comment was tongue-in-cheek as I'm sure you were aware. Peter
Hello Tim,

>> >>> 2) Write 0x1984 to the watchdog RST register to seed the counter. >>> (Goodness knows why they chose that value) >> >> It's probably the lead developer's dog's birthday written in base 9 and >> shown as a hex number. Almost certainly there is an ex post facto >> explanation as to why it is the technically sound choice. >> >>> Then I periodically write Ox1984 to the RST register to keep everything >>> alive. >> >> Silly question, but "periodically" = inside an ISR? >> > Oh honestly Lewin, where else would you kick the dog? >
Kicking is animal cruelty...
> Do you know of any really good discussions of the care and feeding* of > watchdogs?
"Go Natural" works best for our shepherd mix, can be bought at our local feed store ;-) -- Regards, Joerg http://www.analogconsultants.com
"Peter Dickerson" <first{dot}surname@tesco.net> wrote in message 
news:n%XNg.17088$SH2.6685@newsfe4-gui.ntli.net...
> "Steve at fivetrees" <steve@NOSPAMTAfivetrees.com> wrote in message > news:VcSdnRx_c7j92pXYnZ2dnUVZ8qGdnZ2d@pipex.net... >> "Peter Dickerson" <first{dot}surname@tesco.net> wrote in message >> news:5aXNg.17075$SH2.4122@newsfe4-gui.ntli.net... >> > "Tom Lucas" <news@REMOVE_auto_THIS_flame_TO_REPLY.clara.co.uk> wrote in >> > message news:1158161579.6562.0@proxy00.news.clara.net... >> >> I've been trying to implement the watchdog timer on my Sharp79524 and > it >> >> appears that the mutt is sleeping on the job! >> > >> > I'm using a 75410, which has a watchdog that looks the same. I don't >> > use >> > it >> > because it is only any use in faulty software and if I had faulty > software >> > why would I expect the watchdog code to be any better. However, I can > test >> > it out. >> >> I fear you're missing the point of a watchdog. >> >> A watchdog isn't there to catch faulty software - as you say, you > shouldn't >> have any. (Although some would disagree). It's there as an EMI-recovery >> device. *Any* microprocessor-based product, no matter how well designed, > can >> be made to go "off in the weeds" with a strong enough EMI spike. The >> watchdog is there to limit the time the processor can stay off in the > weeds. > > After such a spike the last thing I would worry about is the CPU. That > would > system appear to be working but not actually be. Internal and external EMI > are a big issue for the delicate measurements.
We did a lot of EMI testing on a number of products (albeit some years ago). We found that "going off on the weeds" took a certain finite threshold; we tried turning it up to find the the "permanent damage" threshold, and never did. We passed on the "Nuclear EMP" option.
> In any case my comment was tongue-in-cheek as I'm sure you were aware.
I wasn't, but a) I do now and b) I'm relieved ;). Steve http://www.fivetrees.com
Peter Dickerson wrote:
> "Tom Lucas" <news@REMOVE_auto_THIS_flame_TO_REPLY.clara.co.uk> wrote: > >> I've been trying to implement the watchdog timer on my Sharp79524 >> and it appears that the mutt is sleeping on the job! > > I'm using a 75410, which has a watchdog that looks the same. I > don't use it because it is only any use in faulty software and if > I had faulty software why would I expect the watchdog code to be > any better. However, I can test it out.
There are failure causes other than faulty software. Some are permanent, some transient. Think cosmic rays. -- "I have a creative mind. You (singular) are eccentric. He is insane. We are losing sight of reality. You (plural) are smoking crack. They are certifiable." Declension of verbs, per Lewin Edwards -- Posted via a free Usenet account from http://www.teranews.com
"Peter Dickerson" <first{dot}surname@tesco.net> wrote in message 
news:5aXNg.17075$SH2.4122@newsfe4-gui.ntli.net...
> "Tom Lucas" <news@REMOVE_auto_THIS_flame_TO_REPLY.clara.co.uk> wrote > in > message news:1158161579.6562.0@proxy00.news.clara.net... >> I've been trying to implement the watchdog timer on my Sharp79524 and >> it >> appears that the mutt is sleeping on the job! > > I'm using a 75410, which has a watchdog that looks the same. I don't > use it > because it is only any use in faulty software and if I had faulty > software > why would I expect the watchdog code to be any better. However, I can > test > it out.
Of course, my software is perfect and can never fail so I only need the watchdog in case of alien death rays ;-)
>> I believe I have it set up to trigger after about 3s of inactivity >> but >> it doesn't seem to reset the system at all. >> >> My setup method is as follows: >> 1) Write 0x00000090 to the watchdog CTL to set up for 2^25 counts of >> HCLK as the timeout period. This also stops an interrupt on first >> timeout occurring and should set up for an immediate reset. Watchdog >> not >> enabled at this point > > For me 2^25 counts is 0.65 seconds.
Maybe my maths is a bit off but even at 0.65s then I would expect it to reset - even if I expected it to take longer.
>> 2) Write 0x1984 to the watchdog RST register to seed the counter. >> (Goodness knows why they chose that value) >> >> 3) OR 0x00000001 onto the CTL register to enable the watchdog. >> >> 4) OR 0x00000008 onto the CTL regsiter to lock the enable. > > Yep, reset after a fraction of a second. Using a larger period gave > the > expected results.
Didn't happen for me :-( Is there something in the RCPC registers that needs to be set before watchdogs have any bite? Is there anything that can stop them?
>> Then I periodically write Ox1984 to the RST register to keep >> everything >> alive. >> >> Then if I encounter a while(1); that I've planted somewhere then the >> system hangs but no reset ever happens. >> >> Is there something I've missed? The watchdog section of the user >> guide >> was only a few pages so it would appear to be "simple" but perhaps >> there >> are other things that affect it's operation? >> >> I've tried running under the debugger and also stand-alone from flash >> in >> case that made any difference but it doesn't seem to. >> >> Any ideas? > > I poked 0x90, 0x91 and 0x98 rather than oring but other... > Peter
Hold on I'll try......nope, didn't work. Perhaps there is something in the hardware that can prevent a WDT? Perhaps I have a disabling pin activated or something but I'm not aware of any that it could be.
"Tom Lucas" <news@REMOVE_auto_THIS_flame_TO_REPLY.clara.co.uk> wrote in 
message news:1158161579.6562.0@proxy00.news.clara.net...
> I've been trying to implement the watchdog timer on my Sharp79524 and > it appears that the mutt is sleeping on the job! > > I believe I have it set up to trigger after about 3s of inactivity but > it doesn't seem to reset the system at all.
Problem Solved! It turns out that the address of the watchdog register is actually 0xFFFE3000 instead of the 0xFFFC3000 that is shown in the user guide. This is a case where RTFM has caused the problem! D'oh!
On Wed, 13 Sep 2006 19:09:30 GMT, in comp.arch.embedded Joerg
<notthisjoergsch@removethispacbell.net> wrote:

>Hello Tim, > >>> >>>> 2) Write 0x1984 to the watchdog RST register to seed the counter. >>>> (Goodness knows why they chose that value) >>> >>> It's probably the lead developer's dog's birthday written in base 9 and >>> shown as a hex number. Almost certainly there is an ex post facto >>> explanation as to why it is the technically sound choice. >>> >>>> Then I periodically write Ox1984 to the RST register to keep everything >>>> alive. >>> >>> Silly question, but "periodically" = inside an ISR? >>> >> Oh honestly Lewin, where else would you kick the dog? >> > >Kicking is animal cruelty... > > >> Do you know of any really good discussions of the care and feeding* of >> watchdogs? > > >"Go Natural" works best for our shepherd mix, can be bought at our local >feed store ;-)
OK, a bit late in the thread, but http://ganssle.com/watchdogs.htm martin
"martin griffith" <mart_in_medina@yahoo.esXXX> wrote in message 
news:7tfig2lalvt5a76nlu43bt49e2i3d02b8b@4ax.com...
> On Wed, 13 Sep 2006 19:09:30 GMT, in comp.arch.embedded Joerg > <notthisjoergsch@removethispacbell.net> wrote: > >>Hello Tim, >> >>>> >>>>> 2) Write 0x1984 to the watchdog RST register to seed the counter. >>>>> (Goodness knows why they chose that value) >>>> >>>> It's probably the lead developer's dog's birthday written in base 9 >>>> and >>>> shown as a hex number. Almost certainly there is an ex post facto >>>> explanation as to why it is the technically sound choice. >>>> >>>>> Then I periodically write Ox1984 to the RST register to keep >>>>> everything >>>>> alive. >>>> >>>> Silly question, but "periodically" = inside an ISR? >>>> >>> Oh honestly Lewin, where else would you kick the dog? >>> >> >>Kicking is animal cruelty... >> >> >>> Do you know of any really good discussions of the care and feeding* >>> of >>> watchdogs? >> >> >>"Go Natural" works best for our shepherd mix, can be bought at our >>local >>feed store ;-) > > OK, a bit late in the thread, but > http://ganssle.com/watchdogs.htm
Good link. Thanks.