Thank you for the quick reply Sebastian! > |I just > |want code execution to continue from the instruction after the sleep > |command. The book seems somewhat confusing, but if I disable Global > |Interrupts and enable the EEPROM Write Operation Interrupt > | will this accomplish what I describe? Will I need to enable > |Peripheral Interrupts ? > > Disable GIE (global interrupt), enable EEIE (e2prom interrupt), and enable > PEIE (peripheral interrupt). This way, with GIE disabled, the PIC wake up > executing the next instruction after the SLEEP instruction. Great! This is what I suspected, but the only reference I found in the book kept mentioning when the interrupt flag bit was set. I knew the bit wouldn't be set because the EEPROM wouldn't be finished writing. > > |I am not using interrupts anywhere else in my program so I'd like to > |stay away from them if possible. > > Why? Well, I made that choice for a couple of reasons. First, I am still relatively new to PIC programming and this will be a rather large project for me. I am implementing many new things that I have never used before. Second, should this project be successful, I will hopefully expand on it in the future, and at that point I may need to use interrupts. If I can keep everything going without interrupts right now, I feel it will be slightly cleaner should I ever need to write an interrupt handler. But above all, I don't need them...why use them when all I need is to wake up the microcontroller? > > |If there is no way to wake the > |microcontroller without having it vector to 0x04, can I just have RETFIE > |as the only instruction in my interrupt routine and have it accomplish > |what I need? > > I've never done that, but I think it should work (two instructions: first > clear the EEIF bit by software, then RETFIE). I was pretty sure this method would work too, but it seems such a waste of code. All I need is for the controller to wake up...I know where the interrupt will be from, and I know that all I will want to do is continue code execution. I suppose i wanted a more elegant solution than the "Clear the interrupt bit, then RETFIE" solution. :) Thank you again! Josh Koffman joshy@mb.sympatico.ca