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

Adding WDT to a 12CE674

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



Joined: 01 Sep 2004
Posts: 3
Location: Basingstoke UK

View user's profile Send private message

Adding WDT to a 12CE674
PostPosted: Wed Sep 01, 2004 6:20 am     Reply with quote

Hi from your newest member

I have dabbled for a while with a PIC project and would like to add a WDT to try and make it bullet proof but as with all these things I have a problem.

I am using a 12CE674 and reading a 15kHz frequency on GP3 and ADC from a current sensor on GP0. Because of long delays I have set the prescaler on timer 0 to 1:64 but swap it to 1:1 each time I read the frequency then back to 1:64 again. So how would the WDT fit into this situation? I am probable not understanding the data sheet correctly because it says clrwdt resets the prescaler. Does this mean I have to keep setting the WDT prescaler each time and does it effect timer 0? A bit of code would go a long way!

Thanks in anticipation

Andrew
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Wed Sep 01, 2004 7:30 am     Reply with quote

The prescaler is assigned to either timer0 or WDT, not both. If you enable the WDT, your code needs to call RESTART_WDT() before the WDT times out. This should be about 18ms.
_________________
David
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