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

interrupting other interrupt routines

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



Joined: 11 Feb 2008
Posts: 13

View user's profile Send private message

interrupting other interrupt routines
PostPosted: Tue Dec 15, 2009 9:07 am     Reply with quote

Chip used: 16F887

I'm doing some PWM in software using TIMER0 and would like a TIMER0 overflow to interrupt everything, include other interrupt routines. According to the CCS compiler manual: "If an interrupt is active it is never interrupted." So would be the correct way to code this sort of behavior?
Ttelmah
Guest







PostPosted: Tue Dec 15, 2009 10:13 am     Reply with quote

Get a PIC18.....

The 16 chips, have a _single_ interrupt level. There is no ability for one interrupt to interrupt another....
You could possibly code something, by realising that an interrupt does not have to have a handler, so your 'other interrupt routines', might be done without having a handler, or enabling these, and instead 'polling' the interrupt flags in a tight loop inside your code, then allowing the hardware interrupt to be used for Timer0 only.
However, remember that since interrupt handlers should be exited ASAP, if you set Timer0, to have the highest priority, and keep the other handlers short, then it will be called before the other interrupts, as soon as you exit the other handlers. This would be the 'normal' approach.

On the PIC18, there are two levels of hardware interrupts, which does potentially allow this to be done, but with some 'caveats'. One is that if you are using the INT pin as well, this too will always be assigned as a 'high priority' interrupt, if this feature is used for a timer...

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