M68HC11
REFERENCE MANUAL
RESETS AND INTERRUPTS
MOTOROLA
5-25
The reason for this delayed clear operation can be seen in the next instruction se-
quence:
If there were not a delay in clearing the I bit, it is possible the interrupt could be recog-
nized between the CLI and WAI instructions. Upon return from the interrupt service
routine, the WAI instruction would be executed, and the CPU would erroneously wait
for the interrupt that was just serviced.
During execution of an RTI instruction, the first register to be restored from the stack
is the CCR. In this situation, the one-cycle delay in clearing the I bit expires long before
the RTI instruction is finished; thus, a new interrupt sequence can be started even be-
fore a single instruction of the interrupted program is executed.
5.6 Interrupt Request
The maskable interrupt structure in the M68HC11 can be extended to additional exter-
nal interrupting sources through the IRQ input. This subsection discusses the IRQ in-
put as it relates to the interrupt structure. The alternate use of the IRQ pin as an
EEPROM programming voltage source during factory testing is discussed in
2.2.6 In-
terrupt Pins (XIRQ, IRQ)
.
Although this subsection is primarily concerned with the IRQ pin, there are several ad-
ditional MCU pins that can be used as interrupt inputs. The XIRQ pin provides for non-
maskable interrupts. The main-timer input-capture pins (IC[3:1]) can be used as edge-
sensitive interrupt inputs with separate controls for selecting the significant edge and
separate interrupt vectors. The pulse accumulator input pin can also be used as an
additional edge-sensitive interrupt. If the MCU is operating in single-chip mode, the
strobe A (STRA/AS) pin is available as an edge-triggered interrupt input. Though there
is only one IRQ pin, these other pins allow an MC68HC11A8 to have up to seven in-
terrupt pins.
5.6.1 Selecting Edge Triggering or Level Triggering
The default (most common) configuration for the IRQ pin in an M68HC11 application
is a low-level-sensitive wired-OR network. In less common applications, IRQ can be a
low-going edge-sensitive input. The edge-sensitive configuration is less common be-
cause it only allows a single interrupt source to use the IRQ pin; whereas, the level-
sensitive configuration can accommodate many sources on the single IRQ pin. The
IRQ select edge-sensitive only IRQE bit in the OPTION control register is used to se-
lect the IRQ pin configuration (IRQE = 0 for low level sensitive and IRQE = 1 for low-
going edge sensitive). The IRQE control bit is time-protected, which means it can only
LOOP
CLI
SEI
BRA
Enable Interrupts
Disable Interrupts
Repeat
LOOP
CLI
WAI
Enable Interrupts
Wait for an Interrupt