Renesas M32R/ECU Series User Manual page 280

Mitsubishi 32-bit risc single-chip microcomputers
Table of Contents

Advertisement

10
Example for clearing interrupt request status
Write to the interrupt request status
b4
5
6
1
1
0
Program example
• To clear the Interrupt Request Status Register 0 (ISTREG) interrupt request status 1, ISTAT1 (0x02 bit)
To clear an interrupt request status, always be sure to write "1" to all other interrupt request status bits. At this time,
avoid using a logic operation like the one shown below. Because it requires three step-ISTREG read, logic operation
and write, if another interrupt request occurs between the read and write, status may be inadvertently cleared.
Event occurs on bit 6
Event occurs on bit 4
Figure 10.2.4 Example for Clearing Interrupt Request Status
Initial state
Event occurs on bit 6
Event occurs on bit 4
b7
1
ISTREG = 0xfd;
/* Clear ISTAT1 (0x02 bit) only */
ISTREG &= 0xfd;
/* Clear ISTAT1 (0x02 bit) only */
Interrupt request status
b4
5
0
0
1
0
0
0
MULTIJUNCTION TIMERS
10.2 Common Units of Multijunction Timers
Interrupt request status
6
b4
5
b7
0
0
0
0
0
0
1
0
1
0
1
0
1
0
0
0
6
b7
1
0
Read
0
0
1
1
0
0
0
0
Write
0
0
Only bit 6 cleared
Bit 4 also cleared
10-37
Interrupt request
Only bit 6 cleared
Bit 4 data retained
0
Clear bit 6 (ANDing with 1101)
0
32180 Group User's Manual (Rev.1.0)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents