|
|
View previous topic :: View next topic |
Author |
Message |
W. Baron Guest
|
Using watchdog timer for interrupt timeout |
Posted: Mon Mar 29, 2004 4:49 am |
|
|
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 |
Posted: Mon Mar 29, 2004 7:49 am |
|
|
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. |
|
|
|
|
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
|