
III PERIPHERAL MODULES 1 (SYSTEM): INTERRUPT CONTROLLER (ITC)
III-2-10
EPSON
S1C33E07 TECHNICAL MANUAL
The interrupt controller outputs an interrupt request to the CPU when the following conditions are met:
A cause of interrupt has occurred and the cause-of-interrupt flag is set to 1.
The bit of the interrupt enable register for the cause of interrupt that has occurred is set to 1 (interrupt enable).
The bit of the IDMA request register for the cause of interrupt that has occurred is set to 0 (interrupt request).
If two or more causes of interrupt occur simultaneously, the cause of interrupt that has the highest priority is
allowed to signal an interrupt request to the CPU. (See the following section.)
When these conditions are met, the interrupt controller outputs an interrupt request signal to the CPU along with the
setup content (interrupt level) of the interrupt priority register for the generated interrupt system and its vector number.
These signals remain asserted until the cause-of-interrupt flag is reset to 0 or the corresponding bit of the interrupt
enable register is set to 0 (interrupts are disabled) or until some other cause of interrupt of higher priority occurs.
They are not cleared if the CPU simply accepts the interrupt request.
III.2.4.4 Interrupt Priority Register and Interrupt Levels
The interrupt priority register is a 3-bit register provided for each interrupt system. It allows the interrupt levels
of a given interrupt system to be set in the range of 0 to 7. The default priorities shown in Table III.2.1.1.1 can be
modified according to system requirements by this setting.
The value set in this register is used by the interrupt controller and the CPU as described below.
Roles of the interrupt priority register in the interrupt controller
If two or more causes of interrupt that have been enabled by the interrupt enable register occur simultaneously,
the cause of interrupt in the interrupt system whose interrupt priority register contains the greatest value is
allowed by the interrupt controller to signal an interrupt request to the CPU.
If a cause of interrupt occurs in two or more interrupt systems having the same value, the interrupt priority is
resolved according to the default priorities in Table III.2.1.1.1. Causes of interrupt in the same interrupt system
also have their priorities resolved according to the order in Table III.2.1.1.1.
Other causes of interrupt are kept pending until all interrupts of higher priority are accepted by the CPU.
When outputting an interrupt request signal to the CPU, the interrupt controller outputs the content of the
interrupt priority register to the CPU along with it.
If another cause of interrupt of higher priority occurs during outputting an interrupt request signal, the interrupt
controller changes the vector number and interrupt level to those of the new cause of interrupt before they are
output to the CPU. The first interrupt request is left pending.
Roles of the interrupt priority register in CPU processing
The CPU compares the content of the interrupt priority register received from the interrupt controller with the
interrupt level that is set in the IL of the PSR to determine whether or not to accept the interrupt request.
IE bit = 1 & IL < interrupt priority register: the interrupt request is accepted
IE bit = 1 & IL
≥ interrupt priority register: the interrupt request is rejected
Before interrupts can be controlled by an interrupt level, the interrupt disabling level must be written to the IL.
For example, if the value written to the IL is 3, only the interrupts whose interrupt levels written in the interrupt
priority register are 4 or more will be accepted.
When an interrupt is accepted, the interrupt level that is set in its interrupt priority register is written to the IL.
As a result, the interrupt requests below that interrupt level can no longer be accepted.
If the interrupt priority register for an interrupt is set to 0, the interrupt is disabled. However, invoking IDMA
by means of a cause of interrupt works fine.
Notes: As the C33 PE Core function, the IL allows interrupt levels to be set in the range of 0 to 15.
However, since the interrupt priority register in the ITC consists of three bits, interrupt levels in
each interrupt system can only be set for up to 8.
Multiple interrupts can also be handled by rewriting the interrupt level to the IL in the interrupt
processing routine. However, if the interrupt level of the IL is set below the current level and
the IE is set to enable interrupts before resetting the cause-of-interrupt flag after an interrupt
has occurred, the same interrupt may occur again.