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

questions about interrupt for CCS:)

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








questions about interrupt for CCS:)
PostPosted: Thu Jul 29, 2004 11:12 am     Reply with quote

Formerly, i am writing assemble code for PIC MCU. When we finish the interrupt handling, such as UART or Timer, we should clear the interrupt flag, such as RCIF and INTF. So when i writing code for CCS, there is only enable_interrupts() and disable_interrupts()-- built in function could be usef for interrupt?

So did i still need to clear the interrupt flag after handling the interupt procession:)

thank you:)
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 29, 2004 11:28 am     Reply with quote

Quote:
So did i still need to clear the interrupt flag after handling the interupt procession ?

The compiler does this for you, when you tell it that a routine is an isr
by using the #interrupt directive.

Compile a test program and look at the listing file (.LST) and you
will see this.
Ttelmah
Guest







PostPosted: Thu Jul 29, 2004 2:41 pm     Reply with quote

PCM programmer, has allready posted the answer.
The key 'giveaway', is that one of the options for an interrupt definition, is a flag 'noclear'. If you add this the interrupt is not cleared, otherwise the compiler does it for you.
Beware that the compiler does it at the end of the handler. Hence if events might happen earlier, you might want to use the 'noclear' option, and clear it yourself at the start of the routine, which would allow the flag to be set much earlier, by a repeated event.

Best Wishes
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