Ipl Variation; Interrupt Control Rewrite - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30240 Group

4.1.3.5 IPL Variation

If an interrupt request is accepted, the interrupt priority level of the accepted interrupt is set in the IPL.
If an interrupt request, that does not have an interrupt priority level, is accepted, one of the values
shown in Table 4.6 is set in the IPL.
Table 4.6:
Relationship between interrupts without interrupt priority levels and IPL
Interrupt sources without priority levels
Watchdog timer, NMI
Reset
Other

4.1.3.6 Interrupt Control Rewrite

Rewrite the interrupt control register only when it does not generate the interrupt request for that reg-
ister. If there is possibility of the interrupt request occurring, rewrite the interrupt control register after
the interrupt is disabled. The following describes some program examples:
Example 1:
INT_SWITCH1:
FCLR
AND.B
NOP
NOP
FSET
Example 2:
INT_SWITCH2:
FCLR
AND.B
MOV.W
FSET
Example 3:
INT_SWITCH3:
PUSHC
FCLR
AND.B
POPC
The reason why two NOP instructions or dummy read are inserted before FSET I in Examples 1 and 2, is to
prevent the interrupt enable flag I from being set before the interrupt control register is rewritten due to the
effects of the instruction queue.
When an instruction to rewrite the interrupt control register is executed and the interrupt is disabled,
the interrupt request bit is not always set even if the interrupt request for that register has been gen-
erated. This will depend on the instruction. If this creates problems, use the instructions below to
change the register.
Instructions: AND, OR, BCLR, BSET.
Rev.1.00 Sep 24, 2003 Page 339 of 360
I
:Disable interrupts.
#00h, 0055h
;Clear TA0IC int. priority level and int. request bit.
I
;Enable interrupts.
I
:Disable interrupts.
#00h, 0055h
;Clear TA0IC int. priority level and int. request bit.
MEM, R0
;Dummy read.
I
;Enable interrupts.
FLG
;Push Flag register onto stack
I
;Diable interrupts.
#00h, 0055h
;Clear TA0IC int. priority level and int. request bit.'
FLG
;Enable interrupts.
Overview of Interrupts
Value set in the IPL
7
0
Not changed

Advertisement

Table of Contents
loading

Table of Contents