
III PERIPHERAL MODULES 1 (SYSTEM): INTERRUPT CONTROLLER (ITC)
S1C33E07 TECHNICAL MANUAL
EPSON
III-2-9
III
ITC
III.2.4.3 Cause-of-Interrupt Flag and Interrupt Enable Register
A cause-of-interrupt flag and an interrupt enable register are provided for each cause of maskable interrupt.
Cause-of-interrupt flag
The cause-of-interrupt flag is set to 1 when the corresponding cause of interrupt occurs. Reading the flag
enables you to determine what caused an interrupt, making it unnecessary to resort to the CPU's trap processing.
The cause-of-interrupt flag is reset by writing data in software. Note that the method by which this flag is reset
can be selected from the software application using either of the two methods described below. This selection is
accomplished using RSTONLY (D0/0x30029F).
RSTONLY: Cause-of-Interrupt Flag Reset Method Select Bit in the Flag Set/Reset Method Select Register
(D0/0x30029F)
Reset-only method (default)
This method is selected (RSTONLY (D0/0x30029F) = 1) when initially reset.
With this method, the cause-of-interrupt flag is reset by writing 1. Although multiple cause-of-interrupt flags
are located at the same address of the interrupt control register, the cause-of-interrupt flags for which 0 has been
written can be neither set nor reset. Therefore, this method ensures that only a specific cause-of-interrupt flag is
reset.
However, when using read-modify-write instructions (e.g., bset, bclr, or bnot), note that a cause-of-interrupt
flag that has been set to 1 is reset by writing.
In this method, no cause-of-interrupt flag can be set in the software application.
Read/write method
This method is selected by writing 0 to RSTONLY (D0/0x30029F).
When this method is used, cause-of-interrupt flags can be read and written as for other registers. Therefore,
the flag is reset by writing 0 and set by writing 1. In this case, all cause-of-interrupt flags for which 0 has been
written are reset. Even in a read-modify-write operation, a cause of interrupt can occur between the read and
the write, so be careful when using this method.
Since cause-of-interrupt flags are not initialized by an initial reset, be sure to reset them before enabling
interrupts.
Note: Even when a maskable interrupt request is accepted by the CPU and control branches off to the
interrupt processing routine, the cause-of-interrupt flag is not reset. Consequently, if control is
returned from the interrupt processing routine by the reti instruction without resetting the cause-
of-interrupt flag in a program, the same cause of interrupt occurs again.
For details about cause of interrupt generating conditions, refer to the description of each peripheral circuit in
this manual.
Interrupt enable register
This register controls the output of an interrupt request to the CPU. Only when the interrupt enable bit of this
register is set to 1 can an interrupt request to the CPU be enabled by an occurrence of the corresponding cause
of interrupt. If the bit is set to 0, no interrupt request is made to the CPU even when the corresponding cause of
interrupt occurs.
Interrupt enable bits can be read and written as for other registers. Therefore, the interrupt enable bit is reset by
writing 0 and set by writing 1. By reading this register, its setup status can be checked at any time.
Settings of the interrupt enable register do not affect the operation of cause-of-interrupt flags, so when a cause
of interrupt occurs the cause-of-interrupt flag is set to 1 even if the corresponding interrupt enable bit is set to 0.
When initially reset, the interrupt enable register is set to 0 (interrupts are disabled).
In cases when IDMA is started up by occurrence of a cause of interrupt or when clearing standby mode (HALT
or SLEEP mode) too, the corresponding interrupt enable bit must be set to 1.