Hi,Tazntex
Sleep can work in two manners ...
1) whithout interrupts
ahaaaaa ... here, you just have to re-arm the interrupt flag (RBIF )- but not valid IOC interrupt ( RBIE )
in this case, the program stops @ sleep line and, when awaken, continue from there. here, the NOP added is necessary ...
2) With interrupts enabled ( RBIE valid )
the program stops @ sleep, but jumps to location 4 ( interrupt header ) when awaken ...
so, both cases can be used ... and you can choose the one you have better !!!
just depends on what you want to do.
For the example you show ... interrupts are not necessary at all ... 
just place the sleep command at the beginning of the program ..., and if awaken, program will continue with treating your input ...
then a " GoTo siesta " will re-enter sleep ...
can be placed in a whole " While -wend " infinite loop too ...
Alain
Last edited by Acetronics2; - 22nd May 2010 at 22:42.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks