Interrupts
7-10
Am186™CC/CH/CU Microcontrollers User’s Manual
7.5.3.2
Servicing the Interrupt
Nonmaskable interrupts—the trace interrupt, the NMI/watchdog timer interrupt, and
software interrupts (both user-defined (INT) and software exceptions)—are serviced
regardless of the setting of the IF flag in the FLAGS register. For more information about
nonmaskable interrupts, see “Nonmaskable Interrupts” on page 7-18.
For maskable hardware interrupt requests to be serviced, the IF flag must be set by the
STI instruction, and the mask bit associated with each interrupt must be reset. For more
information about maskable interrupts, see “Maskable Interrupts” on page 7-13.
To service an interrupt request, the processor goes through the following steps:
1. When the processor senses a valid hardware interrupt, it pushes the next instruction
address (CS:IP) and the FLAGS register onto the stack.
2. After the processor pushes the FLAGS register onto the stack, it clears the interrupt
enable flag (IF) to disable maskable interrupts during the interrupt service routine (ISR).
3. The processor then loads the segment:offset values from the interrupt vector table into
the code segment (CS) and the instruction pointer (IP), and begins executing the ISR.
7.5.3.3
Acknowledging the Interrupt
When the microcontroller services an interrupt, it sets the corresponding CHx bit in the
INSERV register.
The microcontroller generates no external acknowledge cycles; the only external indication
that an interrupt is being serviced is that the processor reads the interrupt vector table.
7.5.3.4
End-of-Interrupt (EOI)
Software must write to the End-of-Interrupt (EOI) register to reset the CHx bit in the INSERV
register when an interrupt service routine for a maskable interrupt completes. There are
two types of writes to the EOI register—specific EOI and non-specific EOI.
In a specific EOI, software must specify the interrupt type in the EOI register S bit field to
indicate which CHx bit is to be reset. Specific EOI is applicable when interrupt nesting is
possible or when the highest priority CHx bit that was set does not belong to the service
routine in progress.
In a non-specific EOI, software does not specify which CHx bit is to be reset. Instead, the
interrupt controller clears the CHx bits for all interrupt channels whose priorities match that
of the highest priority interrupt in service.
7.5.3.5
Returning from the Interrupt
The interrupt return (IRET) instruction pops the FLAGS register and the return address off
the stack. Program execution resumes at the point where the interrupt occurred.
The Interrupt Enable (IF) flag is restored by the IRET instruction along with the rest of the
processor status flags. If the IF flag was set before the interrupt was serviced, interrupts
are re-enabled when IRET is executed. If there are valid interrupts pending when the IRET
is executed, the instruction at the return address is not executed. Instead, the processor
services the new interrupt immediately.
If an ISR intends to permanently modify the value of any of the saved flags, it must modify
the copy of the FLAGS register that was pushed onto the stack.
Содержание Am186 CC
Страница 1: ...Am186 CC CH CU Microcontrollers User s Manual Order 21914B...
Страница 4: ...iv Am186 CC CH CU Microcontrollers User s Manual...
Страница 18: ...Table of Contents xviii Am186 CC CH CU Microcontrollers User s Manual...
Страница 24: ...Introduction xxiv Am186 CC CH CU Microcontrollers User s Manual...
Страница 39: ...Architectural Overview Am186 CC CH CU Microcontrollers User s Manual 1 15 Figure 1 6 32 Channel Linecard CH CC...
Страница 40: ...Architectural Overview 1 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 86: ...System Overview 3 36 Am186 CC CH CU Microcontrollers User s Manual...
Страница 92: ...Emulator Support 4 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 112: ...DRAM Controller 6 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 134: ...Interrupts 7 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 186: ...Programmable I O Signals 9 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 200: ...Watchdog Timer 11 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 232: ...Asynchronous Serial Ports UARTs 13 24 Am186 CC CH CU Microcontrollers User s Manual...
Страница 242: ...Synchronous Serial Port SSI 14 10 Am186 CC CH CU Microcontrollers User s Manual...
Страница 264: ...High Level Data Link Control HDLC 15 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 332: ...Universal Serial Bus USB 18 34 Am186 CC CH CU Microcontrollers User s Manual...
Страница 348: ...Register Summary A 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 376: ...Index Index 18 Am186 CC CH CU Microcontrollers User s Manual...