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 CCS Technical Support

Setting up WDT

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



Joined: 11 May 2006
Posts: 78

View user's profile Send private message

Setting up WDT
PostPosted: Tue Jan 09, 2007 2:52 am     Reply with quote

hello all in ccs forums.

could you help me set up a watch dog timer using the prescalers on a PIC 16F688.

I am not using Timer 0 in my program at all so I should be able to get the time out period to be as high as 30 seconds?

I do not fully understand the prescalers envolved with setting up the WDT so any and all help would be most appreciataed.

I would like to use the Watch Dog Timer to check that my program is running ok every 30 seconds, I think I understand that without the prescaler the reset is approx 0.47 seconds is this correct ?

If so how can I change to time out to be as high as 30 seconds (datasheet says 1ms to 268 s here -->

http://ww1.microchip.com/downloads/en/DeviceDoc/41203C.pdf

Thanks for any help in advance.

S Harris

PS Is this correct:-

setup_timer0(RTCC_INTERNAL|RTCC_DIV_1);
setup_counters(RTCC_INTERNAL, WDT_DIV_65536);

what would this give as a WDT reset?

thanks
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

Re: Setting up WDT
PostPosted: Tue Jan 16, 2007 4:59 am     Reply with quote

sjharris wrote:
PS Is this correct:-

Code:
setup_timer0(RTCC_INTERNAL|RTCC_DIV_1);
setup_counters(RTCC_INTERNAL, WDT_DIV_65536);


what would this give as a WDT reset?


Those 2 lines do not setup the WDT. Research the setup_wdt(...) function.
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