CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

CCS C Interrupts

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
stma



Joined: 16 Feb 2004
Posts: 26

View user's profile Send private message

CCS C Interrupts
PostPosted: Mon Feb 28, 2005 11:35 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Mon Feb 28, 2005 12:18 pm     Reply with quote

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.
Guest








PostPosted: Tue Mar 01, 2005 2:11 am     Reply with quote

Thanks...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group