
Originally Posted by
Bruce
Hi Savnik,
The device can wake-up from SLEEP through one of the following events:
1. External RESET input on MCLR pin
2. Watchdog Timer wake-up (if WDT was enabled)
3. Interrupt from RB0/INT pin, RB Port change, or
any Peripheral Interrupt.
If you're not using option #1 or #3, then your left with the watchdog timer, but this has a
period of around 18mS without the prescaler, and 128 * 18mS with a prescaler set to 128.
OPTION_REG = %00001111 would assign the prescaler to the WDT, and give you roughly
2.304 seconds before each wake-up from @ SLEEP.
COUNTER=0 ' clear before entry
WHILE COUNTER < 4
@ SLEEP
COUNTER=COUNTER+1
WEND
Would give roughly 9.2 seconds before exiting the loop, but it's still going to wake-up every
2.304 seconds and increment COUNTER.
Bookmarks