My application requires long periods of sleep until an input is received (may be hours or weeks) - using RA2 wake on interrupt for this, and have WDT disabled to keep it from waking the Pic.
However, sometimes the Pic is freezing up. Running a 16F616 via external oscillator at 20mhz, 5v supply. Works great 99% of the time, but when it does hang, it's a real problem.
I know that's what the WDT was really designed to do, but not sure how it really does it. Here's what I want the Pic to do....
1) If WDT times out during sleep - wake in the same spot of code (just like RA2 had generated the interrupt), check and see if it woke up because of RA2 or because of WDT. If WDT, then clear the bit and go back to sleep, if wake by RA2, continue on...
OR (and this is the really important one I'm not sure I really understand)
2) If the oscillator failed or the Pic hung, to generate a Power On Reset (or equivilant), basically, I want it to re-boot as if the power had been turned off and on and start fresh over.
I'm not sure how it determines one of those 2 actions, and if it does reset due to a hang, if it really is a "complete" reset (like a POR would be)
Thanks!
Bookmarks