Joined: 01 Sep 2004 Posts: 3 Location: Basingstoke UK
Adding WDT to a 12CE674
Posted: Wed Sep 01, 2004 6:20 am
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
Posted: Wed Sep 01, 2004 7:30 am
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
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