INTERRUPTS and PRIORITY 80515

Top  Previous  Next

The 80515, 80535, 80517 and 80537 have more interrupt sources and priority is handled different compared to the 8051.

 

Enable interrupts:

ENABLE AD 'AD converter

ENABLE INT2|INT3|INT4|INT5|INT6  'external interrupt 2-6

ENABLE TIMER2EX  'timer2 external reload

 

Disable interrupts:

DISABLE AD 'AD converter

DISABLE INT2|INT3|INT4|INT5|INT6  'external interrupt 2-6

DISABLE TIMER2EX  'timer2 external reload

 

Selecting of priority:

PRIORITY SET|RESET  source , level

level can be 0,1,2 or 3.(0=lowest,3=highest)

 

The source can be :

INT0/ADC

TIMER0/INT2

INT0/INT3

TIMER1/INT4

SERIAL/INT5

TIMER2/INT6

 

Note that only one of the pairs must be selected.

PRIORITY SET INT4,3  'will set INT4 to the highest priority.

When two ints occur with the same priority the first source in the list will be handled first. So when both TIMER1 and INT4 have the same priority, TIMER1 will be serviced first. Look at a datasheet for more details.