Technical Data
MC68HC11E Family
—
Rev. 4
122
Resets and Interrupts
MOTOROLA
Resets and Interrupts
For some interrupt sources, such as the SCI interrupts, the flags are
automatically cleared during the normal course of responding to the
interrupt requests. For example, the RDRF flag in the SCI system is
cleared by the automatic clearing mechanism consisting of a read of the
SCI status register while RDRF is set, followed by a read of the SCI data
register. The normal response to an RDRF interrupt request would be to
read the SCI status register to check for receive errors, then to read the
received data from the SCI data register. These steps satisfy the
automatic clearing mechanism without requiring special instructions.
5.6.1 Interrupt Recognition and Register Stacking
An interrupt can be recognized at any time after it is enabled by its local
mask, if any, and by the global mask bit in the CCR. Once an interrupt
source is recognized, the CPU responds at the completion of the
instruction being executed. Interrupt latency varies according to the
number of cycles required to complete the current instruction. When the
CPU begins to service an interrupt, the contents of the CPU registers are
pushed onto the stack in the order shown in
Table 5-5
. After the CCR
value is stacked, the I bit and the X bit, if XIRQ is pending, are set to
inhibit further interrupts. The interrupt vector for the highest priority
pending source is fetched and execution continues at the address
specified by the vector. At the end of the interrupt service routine, the
return-from-interrupt instruction is executed and the saved registers are
pulled from the stack in reverse order so that normal program execution
can resume. Refer to
Section 3. Central Processor Unit (CPU)
.
Table 5-5. Stacking Order on Entry to Interrupts
Memory Location
SP
SP
–
1
SP
–
2
SP
–
3
SP
–
4
SP
–
5
SP
–
6
SP
–
7
SP
–
8
CPU Registers
PCL
PCH
IYL
IYH
IXL
IXH
ACCA
ACCB
CCR