there is no interrupt priority in PIC16 and there is single interrupt vector.
when you are in ISR no interrupt will be fired because GIE is disabled
only flags are set
Meaning the priority is decided in your ISR depending on which flag you check first. The flags are set regardless of whether GIE is enabled or not, all GIE does is determine if the program jumps to the ISR. If you are polling the flags you can still use the interrupt system without an ISR but of course it tends to make the program less responsive.
You can actually process all interrupts within the ISR if you really need to.
The typical structure of the ISR is (in pseudocode):
Code:
if interruptFlag1 & interruptEnable1 then
{ ... }
if interruptFlag2 & interruptEnable2 then
{ ... }
As the single ISR will be called with ANY interrupt is triggered, it is quite possible for you to process all active interrupts within the ISR with a single pass. If you don't reset the IF flag for an interrupt (and the IE flags are also set) then the ISR will be called again which is why you must clear the IF flag when you process the interrupt.
If you need to process one interrupt before another and both IF flags are set, then you simply put the code to handle the "one that should do first" before the "other" one within the ISR.
If you are talking about how to tell if the IF flags are being set while you sare inside the ISR then the above scheme will still work. However it almost implies that some part of the ISR is taking some time to process (which would allow the other flags to be set on a regular basis) and that is generally considered a bad thing.
Susan