| ??? 02/25/99 18:18 Read: times |
#256 - RE: Implementation of watchdog timer |
The way I've always done this is to reset the timer somewhere in my mail program loop. For example:
void main (void) { init_everything (); while (1) { reset_watchdog_timer (); task_a (); task_b (); task_c (); } } If you use a multitasking environment, you may want to consider having a watchdog task that waits for signals from all other tasks BEFORE resetting the watchdog. For example... void watchdog_task (void) _task_ 5 { while (1) { reset_watchdog_timer (); wait_for_task_1_signal (); wait_for_task_2_signal (); wait_for_task_3_signal (); wait_for_task_4_signal (); } } Each of the other tasks sends a signal when they complete each pass thru their main loop (and before and probably after any delays). Resetting the watchdog too often is NOT a problem. Jon Ward Keil Software |
| Topic | Author | Date |
| Implementation of watchdog timer | 01/01/70 00:00 | |
| RE: Implementation of watchdog timer | 01/01/70 00:00 | |
| RE: Implementation of watchdog timer | 01/01/70 00:00 | |
| RE: Implementation of watchdog timer | 01/01/70 00:00 | |
| RE: Implementation of watchdog timer | 01/01/70 00:00 | |
RE: Implementation of watchdog timer | 01/01/70 00:00 |



