>This "keep sleeping or wake up" should be entirely decided in the ISR. It cannot be done like that. The ISR has to set a flag, and then return from interrupt, allowing the main program to run around a loop looking at the flag, to see if anything needs to be done. If nothing is required, then the main program puts the CPU to sleep. The ISR should never be putting the CPU to sleep. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist