Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:45 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : WATCHDOG command vs real one...

Author Message
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 06:31pm 19 Jul 2013
Copy link to clipboard 
Print this post

I see now that the latest MMBASIC has a watchdog timer you can set in the software, which is a nice feature - just after we perfected a 555 design in another thread a month or so ago.

With that in mind, and now that we HAVE a watchdog timer in the BASIC, what is the opinion on using an external WDT circuit?

Is it still preferable to use an external one, or is the MM software one good enough that an external hardware WDT can be omitted?

Opinions?
Thoughts?

Smoke makes things work. When the smoke gets out, it stops!
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 08:24pm 19 Jul 2013
Copy link to clipboard 
Print this post

I'd use simple external if it's important. The chip or software can hang up and the internal WDT won't necessarily happen.

John
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3194
Posted: 08:58pm 20 Jul 2013
Copy link to clipboard 
Print this post

The WATCHDOG command will catch the more obvious failures such as a program being stuck in a loop, an error being generated by your program or your program ending up at the command prompt for some reason. An internal error in the processor (an exception) caused by a bug in MMBasic also causes a restart (and runs RESTART.BAS) the same as a WATCHDOG timeout so it will be caught also.

But there is also an outside chance that a cosmic ray strike (or whatever) could cause the PIC32's processor to hang and only an external circuit could catch that. The chances of this are very very rare but it could happen.

But an external circuit does not catch everything. For example a close lightning strike could fry the PIC32's processor and resetting it will not bring it back to life. For that you would need a number MM's running in parallel with some sort of supervisor circuit to disconnect one if it died.

It is really a matter of risk. I would say that the WATCHDOG command would be fine for most uses (such as Gizmo's windmill power system) but if there was the possible loss of many thousands of dollars I would use an external circuit. If there was the risk of injury or loss of life then the MM should not be used in the first place.

Don't forget that the external watchdog circuit is also a risk factor. If, for example, it fails and holds the MM in reset the effect could be just as bad as a bug in your BASIC program.

Geoff
Geoff Graham - http://geoffg.net
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9308
Posted: 10:59pm 20 Jul 2013
Copy link to clipboard 
Print this post

So you're saying that nothing is infallible then, right?(rhetorical)

So noted - I think I will still use the external WDT, only because we spent time here on the forums developing that idea, so I would like to use it rather then just chuck it in the bin. Edited by Grogster 2013-07-22
Smoke makes things work. When the smoke gets out, it stops!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024