Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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


List of 6 messages in thread
TopicAuthorDate
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      

Back to Subject List