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 trade-off 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 80C186EA
Page 1: ...80C186EA 80C188EA Microprocessor User s Manual...
Page 2: ...80C186EA 80C188EA Microprocessor User s Manual 1995...
Page 19: ......
Page 20: ...1 Introduction...
Page 21: ......
Page 28: ...2 Overview of the 80C186 Family Architecture...
Page 29: ......
Page 79: ......
Page 80: ...3 Bus Interface Unit...
Page 81: ......
Page 129: ......
Page 130: ...4 Peripheral Control Block...
Page 131: ......
Page 139: ......
Page 140: ...5 ClockGenerationand Power Management...
Page 141: ......
Page 165: ......
Page 166: ...6 Chip Select Unit...
Page 167: ......
Page 190: ...7 Refresh Control Unit...
Page 191: ......
Page 205: ......
Page 206: ...8 Interrupt Control Unit...
Page 207: ......
Page 239: ...INTERRUPT CONTROL UNIT 8 32...
Page 240: ...9 Timer Counter Unit...
Page 241: ......
Page 265: ......
Page 266: ...10 Direct Memory Access Unit...
Page 267: ......
Page 295: ...DIRECT MEMORY ACCESS UNIT 10 28...
Page 296: ...11 Math Coprocessing...
Page 297: ......
Page 314: ...12 ONCE Mode...
Page 315: ......
Page 318: ...A 80C186 Instruction Set Additions and Extensions...
Page 319: ......
Page 330: ...B Input Synchronization...
Page 331: ......
Page 334: ...C Instruction Set Descriptions...
Page 335: ......
Page 383: ...INSTRUCTION SET DESCRIPTIONS C 48...
Page 384: ...D Instruction Set Opcodes and Clock Cycles...
Page 385: ......
Page 408: ...Index...
Page 409: ......