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 support@ccsinfo.com

Disable Global Interrupt

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



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

Disable Global Interrupt
PostPosted: Fri Mar 14, 2008 3:15 am     Reply with quote

Hello everybody,

I was wondering:
If I Disable the global interrupt for a while and if some interrupts event append during this time, am I going to have these interrupt event when I will enable the global interrupt?

Example:
- enable global interrupt,
- Enable Timer0 overflow interrupt,
- Prog is running,

- Disable global interrupt,

- Prog is running,
- Timer0 overflow append.
- Prog is running,

- Enable global interrupt,
- Am I going to have a Tmer0 overflow interrupt immediately here?
- Prog running.

Thanks for your help.
Ttelmah
Guest







PostPosted: Fri Mar 14, 2008 4:21 am     Reply with quote

Basically, yes.
The interrupt dispatcher is called, if the following conditions are all met:
1) Global interrupt enable is true.
2) Individual interrupt enable is true.
3) Corresponding individual interrupt flag is set.
When you set '1', if the other two things are already true, the interrupt will be called.

The flags latch, so if you don't want interrupts that have occured in the interim to be called, you need to clear the corresponding interrupt bit (clear_interrupts). Beware also though, that some flags (INT_RDE for example), are also dependant on a further hardware event (the buffer containing a character), so this itself needs to be cleared, or the flag will remain set.

Best Wishes
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Fri Mar 14, 2008 5:24 am     Reply with quote

Hi Ttelmah,

Thanks for your answer, it's what I wanted to know.

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