
M68HC11
REFERENCE MANUAL
RESETS AND INTERRUPTS
MOTOROLA
5-23
illegal opcode detection logic treats the TEST opcode as illegal when the MCU is in
normal operating modes and as legal in special test and bootstrap modes.
5.4.3 Software Interrupt
The SWI is executed in the same manner as other instructions and takes precedence
over pending interrupts only if the other interrupts are masked (I and X bits in the CCR
set). The SWI instruction is executed in a manner similar to other maskable interrupts
in that it sets the I bit, CPU registers are stacked, etc. SWI is not inhibited by the global
interrupt mask bits (X or I) in the CCR.
NOTE
The SWI instruction will not be fetched if any other interrupt is pend-
ing. However, once an SWI instruction begins, no other interrupt can
be honored until the SWI vector has been fetched.
SWI instructions are commonly used in debug monitors to transfer control from a user
program to the debug monitor. For example, while operating under monitor control, a
designer can specify a breakpoint at some address in the user program being de-
bugged. The monitor will replace the user’s opcode at this address with the opcode for
an SWI instruction. When the user’s program is running and this SWI opcode is en-
countered, the monitor, recognizing that this is a breakpoint, will take control. The SWI
opcodes are usually placed into the user’s program just before the program is run, and
these locations are restored to the original opcode when the debug monitor regains
control.
5.5 Maskable Interrupts
The remaining twenty interrupt sources in the MC68HC11A8 are subject to masking
by a global interrupt mask bit (I bit in CCR). In addition to the global I bit, all of these
sources except the external interrupt (IRQ pin) are subject to local enable bits in con-
trol registers. Most interrupt sources in the M68HC11 have separate interrupt vectors;
thus, there is usually no need for software to poll control registers to determine the
cause of an interrupt. The maskable interrupt sources respond to a fixed-priority rela-
tionship except that any one source can be dynamically elevated to the highest priority
position of any maskable source.
This subsection discusses the maskable interrupt structure rather than the specific in-
terrupts from individual internal peripheral subsystems. The interrupts associated with
the internal subsystems are discussed throughout this manual during the discussion
of each peripheral system.
5.5.1 I Bit in the Condition Code Register
The I bit in the CCR acts as a primary enable control for all maskable interrupts. When
the I bit is set, interrupts can become pending but will not be honored. When the I bit
is clear, interrupts are enabled to interrupt normal program flow when an interrupt
source requests service.
The I bit is set during reset to prevent interrupts from being honored until minimum sys-