
344
CHAPTER 16 INTERRUPT AND TEST FUNCTIONS
16.4.4 Nesting interrupt service
Acknowledgment of another interrupt request while an interrupt is being serveced is called nesting.
Nesting does not take place unless the interrupts (except the non-maskable interrupt) are enabled to be
acknowledged (IE = 1). Acknowledgment of another interrupt request is disabled (IE = 0) when one interrupt has
been acknowledged. Therefore, to enable nesting, the EI flag must be set to 1 during interrupt servicing, to enable
another interrupt.
Nesting may not occur even when the interrupts are enabled. This is controlled but the priorities of the interrupts.
Although two types of priorities, default priority and programmable priority, may be assigned to an interrupt, nesting
is controlled by using the programmable priority.
If an interrupt with the same level of priority as or higher priority than the interrupt currently serviced occurs, that
interrupt can be acknowledged and nested. If an interrupt with a priority lower than that of the currently serviced
interrupt occurs, that interrupt cannot be acknowledged nor nested.
An interrupt that is not acknowledged and nested because of it is disabled or it has a low priority is kept reserved.
This interrupt is acknowledged after servicing og the current interrupt has been completed and one instruction of the
main routine has been executed.
Nesting is not enabled while the non-maskable interrupt is being serviced.
Table 16-4 shows the interrupts that can be nested, and Figure 16-16 shows an example of nesting.
Table 16-4. Interrupt Request Enabled for Nesting Interrupt during Interrupt Service
Maskable Interrupt Request
PR=0
PR=1
IE=1
IE=0
IE=1
IE=0
Non-maskable interrupt
D
D
D
D
D
ISP=0
E
E
D
D
D
ISP=1
E
E
D
E
D
Software interrupt
E
E
D
E
D
Remarks 1.
E
: Nesting interrupt enable
2.
D : Nesting interrupt disable
3.
ISP and IE are the flags contained in PSW
ISP=0 : An interrupt with higher priority is being serviced
ISP=1 : An interrupt is not accepted or an interrupt with lower priority is being
serviced
IE=0
: Interrupt acknowledge is disabled
IE=1
: Interrupt acknowledge is enabled
4.
PR is a flag contained in PR0L, PR0H, PR1L
PR=0
: Higher priority level
PR=1
: Lower priority level
Interrupt being serviced
Non-maskable
Interrupt
Request
Nesting Interrupt Request
Maskable interrupt