Semiconductor Group
2-10
1998-04-01
CPU Functions
C500 Family
2.7
Basic Interrupt Handling
Each member of the C500 microcontroller family provides several interrupt sources. These
interrupts are generated typically by external events or by the internal peripheral units. If an interrupt
is accepted by the CPU, the microcontroller interrupts a running program and proceeds the program
execution at an interrupt source specific vector address where the interrupt service routine is
located. After the execution of a RETI (return from interrupt) instruction the program is continued at
the point where it has been interrupted.
shows an example for the interrupt vector
addresses of a C500 microcontroller (C501). Generally, interrupt vector addresses are located in
the code memory area starting at address 0003H. The minimum distance between two consecutive
vector addresses is always 8 bytes. Therefore, interrupt vectors can be assigned to the following
addresses: 0003H, 000BH, 0013H, 001BH, 0023H, 002BH, 0033H ...... 00FBH.
Figure 2-4
Interrupt Vector Addresses (Example of the C501)
An interrupt source indicates to the interrupt controller an interrupt condition by setting an interrupt
request flag. The interrupt request flags are sampled in each machine cycle. The sampled flags are
polled during the following machine cycle. If one of the flags was in a set condition in the preceeding
cycle, the polling cycle will find it and the interrupt controller will cause the CPU to branch to the
vector address of the appropriate service routine by generating an internal LCALL. This hardware-
generated LCALL is blocked by any of the following conditions:
1. An interrupt of equal or higher priority is already in progress.
2. The current (polling) cycle is not in the final cycle of the instruction in progress.
3. The instruction in progress is RETI or any write access to interrupt enable or priority registers.
MCD02770
~ ~
~ ~
8 Bytes
H
002B
0023 H
001B H
0013 H
000B H
0003 H
0000 H
Memory
Program
Timer 2
Interrupt
Interrupt
Serial Port
Interrupt
Timer 1
External
Interrupt 1
Interrupt
Timer 0
Interrupt 0
External
Reset
FFFF H