PRIORITY
Action

Sets the priority level of the interrupts.

Syntax

PRIORITY SET / RESET interrupt

Remarks

SET Bring the priority level of the interrupt to a higher level.
RESET Bring the priority level of the interrupt to a lower level.
Interrupt The interrupt to set or reset.
The interrupts are: INT0, INT1, SERIAL, TIMER0, TIMER1 and TIMER2.

Interrupt INT0 always has the highest priority.
When more interrupts occur at the same time the following order is used to handle the interrupts.

Note that other microprocessors can have additional/other interrupt setting.
Read microprocessor support to check the additions.


Interrupt Priority
INT0 1 (highest)
TIMER0 2
INT1 3
TIMER1 4
SERIAL 5 (lowest)
Example


PRIORITY SET SERIAL 'serial int highest level
ENABLE SERIAL 'enable serial int
ENABLE TIMER0 'enable timer0 int
ENABLE INTERRUPTS 'activate interrupt handler
ON SERIAL label 'branch to label if serial int occur
DO 'loop for ever

LOOP

Label: 'start label
PRINT " Serial int occurred." 'print message
RETURN 'return from interrupt