Interrupts
ST72321Bxxx-Auto
Table 14. Interrupt software priority levels
Interrupt software priority
Level
I1
I0
Level 0 (main)
Level 1
Level 2
Level 3 (= interrupt disable)
Low
1
0
0
1
0
0
High
1
1
Figure 17. Interrupt processing flowchart
RESET
RESTORE PC, X, A, CC
FROM STACK
PENDING
Y
INTERRUPT
N
TRAP Y
Interrupt has the same or a
lower software priority
than current one
N
I1:0
FETCH NEXT
INSTRUCTION
THE INTERRUPT
STAYS PENDING
Y “IRET”
N
EXECUTE
INSTRUCTION
STACK PC, X, A, CC
LOAD I1:0 FROM INTERRUPT SW REG.
LOAD PC FROM INTERRUPT VECTOR
Servicing pending interrupts
As several interrupts can be pending at the same time, the interrupt to be taken into account
is determined by the following two-step process:
● the highest software priority interrupt is serviced,
● if several interrupts have the same software priority then the interrupt with the highest
hardware priority is serviced first.
Figure 18 describes this decision process.
Figure 18. Priority decision process flowchart
PENDING
INTERRUPTS
Same
SOFTWARE
PRIORITY
Different
HIGHEST SOFTWARE
PRIORITY SERVICED
HIGHEST HARDWARE
PRIORITY SERVICED
56/247