Quote Originally Posted by Bruce View Post
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.
I use Interrupt on RB4-7 Port change.
I have 4 button on rb4-7 , and if i push any button the pic wake up from sleep
and if i release the butoon the pic go again to sleep.
Now i want the pic every 10 seconds to wake up for .1 sec (without to push any button) and after go again to sleep.