English
Language : 

MC9S08GB60A Datasheet, PDF (68/302 Pages) Freescale Semiconductor, Inc – HCS08 Microcontrollers
Chapter 5 Resets, Interrupts, and System Configuration
UNSTACKING
ORDER
TOWARD LOWER ADDRESSES
²
7
0
51
42
33
24
15
CONDITION CODE REGISTER
ACCUMULATOR
INDEX REGISTER (LOW BYTE X)*
PROGRAM COUNTER HIGH
PROGRAM COUNTER LOW
SP AFTER
INTERRUPT STACKING
SP BEFORE
THE INTERRUPT
²
STACKING
ORDER
²
TOWARD HIGHER ADDRESSES
²
* High byte (H) of index register is not automatically stacked.
Figure 5-1. Interrupt Stack Frame
When an RTI instruction is executed, these values are recovered from the stack in reverse order. As part
of the RTI sequence, the CPU fills the instruction pipeline by reading three bytes of program information,
starting from the PC address just recovered from the stack.
The status flag causing the interrupt must be acknowledged (cleared) before returning from the ISR.
Typically, the flag should be cleared at the beginning of the ISR so that if another interrupt is generated by
this same source, it will be registered so it can be serviced after completion of the current ISR.
5.5.2 External Interrupt Request (IRQ) Pin
External interrupts are managed by the IRQSC status and control register. When the IRQ function is
enabled, synchronous logic monitors the pin for edge-only or edge-and-level events. When the MCU is in
stop mode and system clocks are shut down, a separate asynchronous path is used so the IRQ (if enabled)
can wake the MCU.
5.5.2.1 Pin Configuration Options
The IRQ pin enable (IRQPE) control bit in the IRQSC register must be 1 for the IRQ pin to act as the
interrupt request (IRQ) input. When the pin is configured as an IRQ input, the user can choose the polarity
of edges or levels detected (IRQEDG), whether the pin detects edges-only or edges and levels (IRQMOD),
and whether an event causes an interrupt or only sets the IRQF flag (which can be polled by software).
When the IRQ pin is configured to detect rising edges, an optional pulldown resistor is available rather
than a pullup resistor. BIH and BIL instructions may be used to detect the level on the IRQ pin when the
pin is configured to act as the IRQ input.
NOTE
The voltage measured on the pulled up IRQ pin may be as low as VDD – 0.7
V. The internal gates connected to this pin are pulled all the way to VDD. All
other pins with enabled pullup resistors will have an unloaded measurement
of VDD.
MC9S08GB60A Data Sheet, Rev. 2
68
Freescale Semiconductor