14.13.4 Changing An Interrupt Source - Renesas M16C/64C User Manual

Table of Contents

Advertisement

M16C/64C Group

14.13.4 Changing an Interrupt Source

When the interrupt source is changed, the IR bit in the interrupt control register may become 1
(interrupt requested). To use an interrupt, change the interrupt source, and then set the IR bit to 0
(interrupt not requested).
In this section, the changing of an interrupt source refers to all elements used in changing the interrupt
source, polarity, and timing assigned to each software interrupt number. Therefore, if a mode change of
any peripheral function involves changing the source, 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
descriptions of the individual peripheral functions for details of the interrupts.
Figure 14.12 shows the Procedure for Changing the Interrupt Generate Source.
Use the MOV instruction to set the IR bit to 0 (interrupt not requested)
IR bit: A bit in the interrupt control register
Notes:
1. Execute the above settings individually. Do not use one instruction to execute two or more settings simultaneously.
2. Use the I flag for the INTi interrupt (i = 0 to 7).
For the interrupts from peripheral functions other than the INTi interrupt, disable the peripheral function that is the
source of the interrupt so as not to generate an interrupt request before changing the interrupt source. In this case,
if the maskable interrupts can all be disabled without causing a problem, use the I flag. Otherwise, use
corresponding bits ILVL2 to ILVL0 in the interrupt control register whose interrupt source is to be changed.
3. Refer to 14.13.5 "Rewriting the Interrupt Control Register" for details about the instructions to be used and the
notes to be taken for instruction execution.
Figure 14.12 Procedure for Changing the Interrupt Generate Source
R01UH0092EJ0110 Rev.1.10
Jul 31, 2012
Change the interrupt source
Disable interrupts
Change the interrupt source
(including a mode change of peripheral function)
Enable interrupts
Change completed
(2, 3)
(2, 3)
14. Interrupts
(3)
Page 221 of 807

Advertisement

Table of Contents
loading

This manual is also suitable for:

M16c/60 seriesM16c series

Table of Contents