Hi,
When you put the PIC to sleep the main oscillator shuts down. If the timer you're using to generate the interrupt is clocked from the main oscillator (ie you're not clocking it from an external source) then the timer stops incrementing and will never overflow thus never generating the interrupt that's supposed to wake the PIC up again.
There are several possible ways to do what you want, I'm going to sugest one here. TMR1 has its own oscillator which can be driven by an external x-tal, for example a 32.768kHz clock x-tal. When clocked externally it won't stop counting when the rest of the PIC goes to sleep so the interrupt caused by the timer overflow will wake it up.
Depending on the PIC you're using there may be various power managed mode, for example Idle. In Idle mode the CPU core is shut down but any enabled peripherals such as the timer(s) are still clocked. Take a look at the Power Managed Modes section in the datasheet for the particular PIC you're using.
/Henrik.




Bookmarks