INTERRUPT CONTROL UNIT
8-4
The priority of each source is programmable. The Interrupt Control register enables the
programmer to assign each source a priority that differs from the default. The priority must still
be between zero (highest) and seven (lowest). Interrupt sources can be programmed to share a
priority. The Interrupt Control Unit uses the default priorities (see Table 8-1) within the shared
priority level to determine which interrupt to service first. For example, assume that INT0 and
INT1 are both programmed to priority seven. Because INT0 has the higher default priority, it is
serviced first.
Interrupt sources can be masked on the basis of their priority. The Priority Mask register masks
all interrupts with priorities lower than its programmed value. After reset, the Priority Mask reg-
ister contains priority seven, which effectively enables all interrupts. The programmer can then
program the register with any valid priority level.
8.2.1.3
Interrupt Nesting
When entering an interrupt handler, the CPU pushes the Processor Status Word onto the stack
and clears the Interrupt Enable bit. The processor enters all interrupt handlers with maskable in-
terrupts disabled. Maskable interrupts remain disabled until either the IRET instruction restores
the Interrupt Enable bit or the programmer explicitly enables interrupts. Enabling maskable in-
terrupts within an interrupt handler allows interrupts to be nested. Otherwise, interrupts are pro-
cessed sequentially; one interrupt handler must finish before another executes.
The simplest way to use the Interrupt Control Unit is without nesting. The operation and servicing
of all sources of maskable interrupts is straightforward. However, the application tradeoff is that
an interrupt handler will finish executing even if a higher priority interrupt occurs. This can add
considerable latency to the higher priority interrupt.
In the simplest terms, the Interrupt Control Unit asserts the maskable interrupt request to the CPU,
waits for the interrupt acknowledge, then presents the interrupt type of the highest priority un-
masked interrupt to the CPU. The CPU then executes the interrupt handler for that interrupt. Be-
cause the interrupt handler never sets the Interrupt Enable bit, it can never be interrupted.
The function of the Interrupt Control Unit is more complicated with interrupt nesting. In this case,
an interrupt can occur during execution of an interrupt handler. That is, one interrupt can preempt
another. Two rules apply for interrupt nesting:
•
An interrupt source cannot preempt interrupts of higher priority.
•
An interrupt source cannot preempt itself. The interrupt handler must finish executing
before the interrupt is serviced again. (Special Fully Nested Mode is an exception. See
“Special Fully Nested Mode” on page 8-8.)
Summary of Contents for 80C186XL
Page 1: ...80C186XL 80C188XL Microprocessor User s Manual...
Page 2: ...80C186XL 80C188XL Microprocessor User s Manual 1995...
Page 18: ...1 Introduction...
Page 19: ......
Page 27: ......
Page 28: ...2 Overview of the 80C186 Family Architecture...
Page 29: ......
Page 79: ......
Page 80: ...3 Bus Interface Unit...
Page 81: ......
Page 127: ......
Page 128: ...4 Peripheral Control Block...
Page 129: ......
Page 137: ......
Page 138: ...5 ClockGenerationand Power Management...
Page 139: ......
Page 154: ...6 Chip Select Unit...
Page 155: ......
Page 178: ...7 Refresh Control Unit...
Page 179: ......
Page 193: ......
Page 194: ...8 Interrupt Control Unit...
Page 195: ......
Page 227: ......
Page 228: ...9 Timer Counter Unit...
Page 229: ......
Page 253: ......
Page 254: ...10 Direct Memory Access Unit...
Page 255: ......
Page 283: ......
Page 284: ...11 Math Coprocessing...
Page 285: ......
Page 302: ...12 ONCE Mode...
Page 303: ......
Page 306: ...A 80C186 Instruction Set Additions and Extensions...
Page 307: ......
Page 318: ...B Input Synchronization...
Page 319: ......
Page 322: ...C Instruction Set Descriptions...
Page 323: ......
Page 371: ......
Page 372: ...D Instruction Set Opcodes and Clock Cycles...
Page 373: ......
Page 396: ...Index...
Page 397: ......