
R8C/36T-A Group
11. Interrupts
Under development Preliminary document
Specifications in this document are tentative and subject to change.
R01UH0240EJ0010 Rev.0.10
Page 141 of 728
Aug 05, 2011
11.4
Interrupt Control
The following describes enabling and disabling maskable interrupts and setting the priority for acknowledgement.
This description does not apply to non-maskable interrupts.
Use the I flag in the FLG register, IPL, and bits ILVL2 to ILVL0 in the corresponding interrupt control register to
enable or disable a maskable interrupt. Whether an interrupt is requested or not is indicated by the IR bit in the
corresponding interrupt control register.
11.4.1
I Flag
The I flag enables or disables maskable interrupts. Setting the I flag to 1 (enabled) enables maskable interrupts.
Setting the I flag to 0 (disabled) disables all maskable interrupts.
11.4.2
IR Bit
The IR bit is set to 1 (interrupt requested) when an interrupt request is generated. After the interrupt request is
acknowledged and the CPU branches to the corresponding interrupt vector, the IR bit is set to 0 (no interrupt
requested).
The IR bit can be set to 0 by a program. Do not write 1 to this bit.
However, the IR bit operations of the timer RC interrupt, the timer RE2 interrupt, the synchronous serial
communication unit/I2C bus interface interrupt, and the flash memory interrupt are different. Refer to 11.8 11.4.3
Bits ILVL2 to ILVL0, IPL
Interrupt priority levels can be set using bits ILVL2 to ILVL0.
The following are the conditions when an interrupt is acknowledged:
I flag = 1
IR bit = 1
Interrupt priority level > IPL
The I flag, IR bit, bits ILVL2 to ILVL0, and IPL are independent of each other. They do not affect one another.
Table 11.6
Interrupt Priority Level Settings
Bits ILVL2 to
ILVL0
Interrupt Priority Level
Priority
000b
Level 0 (interrupt disabled)
—
001b
Level 1
Low
High
010b
Level 2
011b
Level 3
100b
Level 4
101b
Level 5
110b
Level 6
111b
Level 7
Table 11.7
Interrupt Priority Levels Enabled by
IPL
IPL
Enabled Interrupt Priority Level
000b
Interrupt level 1 and above
001b
Interrupt level 2 and above
010b
Interrupt level 3 and above
011b
Interrupt level 4 and above
100b
Interrupt level 5 and above
101b
Interrupt level 6 and above
110b
Interrupt level 7 and above
111b
All maskable interrupts are disabled