![Freescale Semiconductor MC9S12ZVM series Reference Manual Download Page 141](http://html1.mh-extra.com/html/freescale-semiconductor/mc9s12zvm-series/mc9s12zvm-series_reference-manual_2330602141.webp)
Chapter 4 Interrupt (S12ZINTV0)
MC9S12ZVM Family Reference Manual Rev. 1.3
Freescale Semiconductor
141
•
Initialize the interrupt processing level configuration data registers (INT_CFADDR,
INT_CFDATA0–7) for all interrupt vector requests with the desired priority levels. It might be a
good idea to disable unused interrupt requests.
•
Enable I-bit maskable interrupts by clearing the I-bit in the CCW.
•
Enable the X-bit maskable interrupt by clearing the X-bit in the CCW (if required).
4.5.2
Interrupt Nesting
The interrupt request priority level scheme makes it possible to implement priority based interrupt request
nesting for the I-bit maskable interrupt requests.
•
I-bit maskable interrupt requests can be interrupted by an interrupt request with a higher priority,
so that there can be up to seven nested I-bit maskable interrupt requests at a time (refer to
for an example using up to three nested interrupt requests).
I-bit maskable interrupt requests cannot be interrupted by other I-bit maskable interrupt requests per
default. In order to make an interrupt service routine (ISR) interruptible, the ISR must explicitly clear the
I-bit in the CCW (CLI). After clearing the I-bit, I-bit maskable interrupt requests with higher priority can
interrupt the current ISR.
An ISR of an interruptible I-bit maskable interrupt request could basically look like this:
•
Service interrupt, e.g., clear interrupt flags, copy data, etc.
•
Clear I-bit in the CCW by executing the CPU instruction CLI (thus allowing interrupt requests with
higher priority)
•
Process data
•
Return from interrupt by executing the instruction RTI
Figure 4-14. Interrupt Processing Example
0
Reset
4
0
7
6
5
4
3
2
1
0
L4
7
0
4
L1 (Pending)
L7
L3 (Pending)
RTI
4
0
3
0
RTI
RTI
1
0
0
RTI
Stacked IPL
Processing Levels
IPL in CCW