|
|
View previous topic :: View next topic |
Author |
Message |
bmoore
Joined: 11 Feb 2008 Posts: 13
|
interrupting other interrupt routines |
Posted: Tue Dec 15, 2009 9:07 am |
|
|
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
|
|
Posted: Tue Dec 15, 2009 10:13 am |
|
|
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 |
|
|
|
|
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
|