Execution Order

The Interrupt Handlers are executed in the same Order they are listed in the INT_LIST macro.

If something needs to be done Immediately after the interrupt occurs, then it should be placed at the top of the list. This might include capturing a Timer value or turning an Output ON etc.

Any interrupt source can have either an ASM or a PBP type of Handler. In fact, a single interrupt source might have both. You might place an ASM handler at the top of the list, and then have a PBP handler further down the list. This way you can capture a value immediately, and then process it latter when it's not critical. Just make sure that the first one does NOT reset the interrupt Flag, or the second one will not execute. Here's a simple example of what it might look like.

Example 4:


ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler CCP1_INT, Pre_SQ_wave, ASM, no
INT_Handler TMR0_INT, int_handler, ASM, yes
INT_Handler TMR1_INT, _T1_ovrFlow, PBP, yes
INT_Handler CCP1_INT, _SQ_wave, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

When splitting handlers into 2 parts, both parts must be in the same Priority INT_LIST.

Page last modified on March 02, 2018, at 04:32 AM