Download Print this page

Renesas M16C/50 Series User Manual page 808

Advertisement

M16C/5L Group, M16C/56 Group
28.8.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 28.8 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 5).
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 28.8.5 "Rewriting the Interrupt Control Register" for details about the instructions to be used and the notes
to be taken for instruction execution.
Figure 28.8
Procedure for Changing the Interrupt Generate Source
R01UH0127EJ0110 Rev.1.10
Sep 01, 2011
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)
28. Usage Notes
(3)
Page 771 of 803

Advertisement

loading