
iiiPeriPheraLModuLes1(systeM):interruPtControLLer(itC)
iii-2-10
ePson
s1C33L17teChniCaLManuaL
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.4interruptPriorityregisterandinterruptLevels
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.
rolesoftheinterruptpriorityregisterintheinterruptcontroller
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.
rolesoftheinterruptpriorityregisterinCPuprocessing
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: AstheC33PECorefunction,theILallowsinterruptlevelstobesetintherangeof0to15.
However,sincetheinterruptpriorityregisterintheITCconsistsofthreebits,interruptlevelsin
eachinterruptsystemcanonlybesetforupto8.
MultipleinterruptscanalsobehandledbyrewritingtheinterruptleveltotheILintheinterrupt
processingroutine.However,iftheinterruptleveloftheILissetbelowthecurrentleveland
theIEissettoenableinterruptsbeforeresettingthecause-of-interruptflagafteraninterrupt
hasoccurred,thesameinterruptmayoccuragain.