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

watch dog timer and pic18f452

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



Joined: 13 Oct 2003
Posts: 32

View user's profile Send private message Send e-mail

watch dog timer and pic18f452
PostPosted: Tue Feb 22, 2005 8:02 am     Reply with quote

I am using the PIC18f452 with WDT to reset.
The WDT timer only has a reset time on 1:128 which is not sufficient time.
I would like the timer to reset after 2 seconds.
My crystal is a 4 MHz.
How do I go about this

Thanks
Delene Confused
Ttelmah
Guest







PostPosted: Tue Feb 22, 2005 9:10 am     Reply with quote

The 128 prescaler gives, a nominal 2.3 seconds timeout.
Remember the watchdog is running of it's own internal 'clock', not your crrystal. The watchdog interval is nominally 18mSec (caveat though, this changes a _lot_ with wide temperature excursions...). Hence the 128 prescaler gives 18E-3 * 128 = 2.304 seconds.
If you want longer watchdog times than this, the alternative is to have a system 'tick', running at say 100Hz, then in this reset the watchdog, if a counter is not zero, and decrement the counter. Set the counter to any value you require to give longer watchdog timeouts.

Best Wishes
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