3 ms·
It's dead common in embedded software, such as avionics. Every task needs a watchdog timer. Basically you 'ping' the timer every so often, which resets it to (s
by RogerL 5y ago
It's dead common in embedded software, such as avionics. Every task needs a watchdog timer. Basically you 'ping' the timer every so often, which resets it to (say) 1 second (or whatever makes sense for your task) Then it counts down. If it reaches zero, meaning one second has passed since it was reset it will trigger an interrupt. You of course design your system so that your task trips it every 500 ms (say). You don't ever want that watchdog to expire. But, being human, we write infinite loops, or code that takes 'too long' to run. And so when the watchdog triggers the interrupt that is a signal that you have some kind of sw or possibly hardware issue. You shut down or restart that task, and/or do other remedial actions, like alert the pilot in human manned airframes. You of course have to be very thorough in your design here, as this is your last chance to react to these errors.