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

Using watchdog timer for interrupt timeout

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







Using watchdog timer for interrupt timeout
PostPosted: Mon Mar 29, 2004 4:49 am     Reply with quote

Hi,

I'm try to use the watchdog timer on the 16F628a to check for timeout. I start the 18ms timer and then put the processor in sleep mode. If the expected interrupt doesn't occur the wdt wakes the processor and wakeup_reason returns WDT_FROM_SLEEP.
The problem is that if the interrupt does occur and the processor wakes up and at that moment the wdt times out, it seems that the processor could be reset before the wake up reason can be checked and the watchdog restarted.

Is there a way around this? Is the wakeup_reason reset when the watchdog is restarted and if not, could the sleep+1 instruction be used to restart the watchdog to ensure the processor doesn't reset, and then the reason read?

Any thoughts would be welcome,

Cheers,
Wiebe.
W.Baron
Guest







Re: Using watchdog timer for interrupt timeout
PostPosted: Mon Mar 29, 2004 7:49 am     Reply with quote

I seem to have found the answer, any wakeup from sleep resets the watchdog timer. But this leads to the following question; is it then possible to callibrate the timer without a reset (ie. other then writing a timer to the EEPROM and using the last value before reset)?

Thanks,
Wiebe.
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