Could somebody please explain the CCS interrupt process for me. i.e. where program jumps back to after isr. I can't seem to get it to be consistent. My program has a menu with an option to sleep. during sleep program woken by rb0 int and does isr (simple character display) then after isr i want it to go back to sleep i.e. resume where it was but it jumps every other interrupt goes to the menu (command prior to sleep function).
Help...thanks
Steve
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
Posted: Mon Feb 28, 2005 12:18 pm
It doesn't have anything to do with CCS interrupts. It has to do with the PIC. Read the datasheet. The next instruction is prefetched while the sleep is being executed. If the GIE bit is set, then that instruction is executed and the program branches to the isr routine. If GIE is clear, then the program just resumes with the instruction after the sleep. You code is going to have to handle where it wakes up and allow it to go back to sleep. Maybe put the sleep into a loop. If it wakes up, the interrupt will be processed and then another sleep will get executed and the micro will go back to sleep. Of course you will probably have some flag to allow you to come back out of sleep mode unless everything is handled in the ISR.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum