CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Regarding watchdog timer usage.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jaikumar



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

Regarding watchdog timer usage.
PostPosted: Wed Jul 21, 2010 12:02 am     Reply with quote

If in my program the tasks are scheduled by using Timer1, do I still need to use watchdog timer for the purpose of recovering from error when that happens.
If so, please provide some info.

Regards,
Jai
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 21, 2010 12:51 pm     Reply with quote

If your main loop calls several tasks like the one shown below, then I
think the best place to put the restart_wdt() statement is in the main loop.
Code:

while(1)
  {
   task1();
   task2();
   task3();

   restart_wdt();
  }

This way, if one of your tasks locks up, it won't return to the main loop
and the Watchdog will reset the system.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group