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

setup_wdt(2304_MS)

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







setup_wdt(2304_MS)
PostPosted: Wed Sep 01, 2004 8:00 am     Reply with quote

I tried using setup_wdt(2304_MS) on a PIC16F627, using internal oscillator, and I used it as a timer. Everytime I woke up from sleep, i'd increment my timer, then go back to sleep.

I found that by using the "2304ms" option, over time, it actually averaged to 2.85ms.

Is the WDT's RC not that exact? Or is "2304ms" a misnomer?

Thanks,
Mike
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Wed Sep 01, 2004 10:35 am     Reply with quote

Look in the datasheet and you will find the Min, Type, and Max values.

An example for the 16F87X family with out the prescaler is

Min 7ms
Typ 18ms
Max 33ms

which with the prescaler set to max would have a range from 896ms to 4.224 seconds.
valemike
Guest







PostPosted: Wed Sep 01, 2004 11:41 am     Reply with quote

Thanks Mark. Darn, looks like i'll need a 32khz external oscillator! Then again, i can always tweak that number per chip shipped. oh well.

-Mike
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Wed Sep 01, 2004 11:47 am     Reply with quote

Temp will also affect that time
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Sep 01, 2004 11:50 am     Reply with quote

The problem is not just accuracy but stability. The timeout is likely to vary with temperature, voltage, age, and who knows what else. It is file as a watchdog but doesn't even try to be exact.
_________________
The search for better is endless. Instead simply find very good and get the job done.
valemike
Guest







PostPosted: Wed Sep 01, 2004 7:47 pm     Reply with quote

I was thinking of letting the thing "self-calibrate" itself. That is, I would sample one of the timers, let the wdog trigger, and read one of the timers again. But then, i realized that it would reset, since the wdog would time out. (Unlike when your're in sleep, then the wdog timeout will only wake it up). Nor can i use tmr1,2, or 3 to measure since they don't run when asleep.

So i guess i can just get an external clock which supposedly will keep counting for two minutes. Then again, i can just stay awake for two minutes. That's probably better.
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