Looking for something like a watchdog but not for resetting.

Hi Everyone,

I am looking for something like a watchdog but I don't want to reset the system but call a function if the "watchdog" is tripped. I am pretty sure that there is a practical way or a library for that but I can't find it.
Would anyone be so kind to point me in the right direction..

Thanks in advance

See : timer thread next to yours.

-jim lee

The watchdog timer triggers an interrupt. You can use that ISR just like any other.

I was going to recommend the timeObj.h library but Jim beat me to it.

The timeObj library greatly simplifies some millis() operations.

The important thing that sets a watchdog apart, is that it works in hardware, and has no dependence on software...

If your code falls into a ‘deadly embrace’, it will never get out to check the ‘activity monitor’... in which case, it can’t help you detect an unknown software failure.

But you can perform health checks - if they’re written perfectly, that can modify the operation of your code.

lastchancename:
The important thing that sets a watchdog apart, is that it works in hardware, and has no dependence on software...

If your code falls into a ‘deadly embrace’, it will never get out to check the ‘activity monitor’... in which case, it can’t help you detect an unknown software failure.

But you can perform health checks - if they’re written perfectly, that can modify the operation of your code.

Yes but..

"I don't want to reset the system but call a function if the "watchdog" is tripped." Tells me that the software is still "alive".

-jim lee

lastchancename:
The important thing that sets a watchdog apart, is that it works in hardware, and has no dependence on software...

There are hardware watchdog timers and software WDT.

jimLee:
Yes but..

"I don't want to reset the system but call a function if the "watchdog" is tripped." Tells me that the software is still "alive".

-jim lee

That's correct... And the library of Yours looks like a real goody-bag.. Thanks.

Wow! Well..

Thank you.

Enjoy!

-jim lee

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.