Interrupt Priorities

10.5 Interrupt Priorities

The MSC1210 offers three levels of interrupt priority: highest, high, and low. By using interrupt priorities, higher priority may be assigned to certain interrupt conditions. The highest priority is reserved for the auxiliary interrupt that vec- tors through address 0033H—the auxiliary interrupt is always of highest prior- ity and no other interrupt may be assigned that priority.

All other interrupts may be assigned either high or low priority. For example, assume the Timer 1 interrupt has been enabled to be automatically called ev- ery instance Timer 1 overflows. Additionally, the serial interrupt has been en- abled to be called every time a character is received via the serial port. Howev- er, in this case, receiving a character is much more important than the timer interrupt. Therefore, if the Timer 1 interrupt is already executing, the serial in- terrupt must interrupt the Timer 1 interrupt. When the serial interrupt is com- plete, control passes back to the Timer 1 interrupt and finally back to the main program. This may be accomplished by assigning a high priority to the serial interrupt and a low priority to the Timer 1 interrupt.

Interrupt priorities are controlled by the IP (B8H) or EIP (F8H) SFRs. These SFRs have the following formats, as shown in Table 10−5 and Table 10−6.

Table 10−5.IP (B8 H ) SFR

Bit

Name

Bit Address

Explanation of Function

 

 

 

 

7

BFH

Undefined

6

BEH

Undefined

5

BDH

Undefined

4

PS

BCH

Serial Interrupt Priority

3

PT1

BBH

Timer 1 Interrupt Priority

2

PX1

BAH

External 1 Interrupt Priority

1

PT0

B9H

Timer 0 Interrupt Priority

0

PX0

B8H

External 0 Interrupt Priority

Table 10−6.EIP (F8 H ) SFR

Bit

Name

Bit Address

Explanation of Function

 

 

 

 

7

FFH

Undefined (set to 1)

6

FEH

Undefined (set to 1)

5

FDH

Undefined (set to 1)

4

PWDI

FCH

Watchdog Interrupt Priority

3

PX5

FBH

External Interrupt 5 Priority

2

PX4

FAH

External Interrupt 4 Priority

1

PX3

F9H

External Interrupt 3 Priority

0

PX2

F8H

External Interrupt 2 Priority

Interrupts 10-7

Page 113
Image 113
Texas Instruments MSC1210 manual Interrupt Priorities, 5.IP B8 H SFR, 6.EIP F8 H SFR