English
Language : 

M16C6S_09 Datasheet, PDF (191/208 Pages) Renesas Technology Corp – SINGLE-CHIP 16-BIT CMOS MICROCOMPUTER
M16C/6S Group
Usage Notes
Changing the Interrupt Generate Factor
If the interrupt generate factor is changed, the IR bit in the interrupt control register for the changed interrupt
may inadvertently be set to 1 (interrupt requested). If you changed the interrupt generate factor for an
interrupt that needs to be used, be sure to clear the IR bit for that interrupt to 0 (interrupt not requested).
“Changing the interrupt generate factor” referred to here means any act of changing the source, polarity or
timing of the interrupt assigned to each software interrupt number. Therefore, if a mode change of any
peripheral function involves changing the generate factor, polarity or timing of an interrupt, be sure to clear
the IR bit for that interrupt to 0 (interrupt not requested) after making such changes. Refer to the description
of each peripheral function for details about the interrupts from peripheral functions.
Figure 1.24.1 shows the procedure for changing the interrupt generate factor.
Changing the interrupt source
Disable interrupts (2,3)
Change the interrupt generate factor
(including a mode change of peripheral function)
Use the MOV instruction to clear the IR bit to 0
(interrupt not requested) (3)
Enable interrupts (2,3)
End of change
IR bit: A bit in the interrupt control register for the interrupt whose interrupt generate factor
is to be changed.
NOTES:
1. The above settings must be executed individually. Do not execute two or more settings
simultaneously (using one instruction).
2. Use the I flag for the INTi interrupt (i = 0 to 5).
For the interrupts from peripheral functions other than the INTi interrupt, turn off the
peripheral function that is the source of the interrupt in order not to generate an interrupt
request before changing the interrupt generate factor. In this case, if the maskable interrupts
can all be disabled without causing a problem, use the I flag. Otherwise, use the corresponding
bits ILVL2 to ILVL0 for the interrupt whose interrupt generate factor is to be changed.
3. Refer to Rewrite the Interrupt Control Register for details about the instructions to use
and the notes to be taken for instruction execution.
Figure 1.24.1 Procedure for Changing the Interrupt Generate Factor
Rev.5.01 Dec 10, 2009 page 191 of 201
REJ03B0014-0501