For interrupt request flag is set right after interrupt request is cleared, interrupt process to one time
timer FH, timer FL interrupt might be repeated. (Figure1-2)
Therefore, to definitely clear interrupt request flag in active (high-speed, medium-speed) mode, clear
should be processed after the time that calculated with below (1) formula. And, to definitely clear
timer overflow flag and compare match flag, clear should be processed after read timer control
status register F(TCSRF) after the time that calculated with below (1) formula.
For ST of (1) formula, please substitute the longest number of execution states in used instruction.
(10 states of RTE instruction when MULXU, DIVXU instruction is not used, 14 states when MULXU,
DIVXU instruction is used)
In subactive mode, there are no limitation for interrupt request flag, timer overflow flag, and compare
match flag clear.
The term of validity of “Interrupt factor generation signal”
=1 cycle of
φ
w + waiting time for completion of executing instr
interrupt time synchronized with
φ
=1/
φ
w +ST
×
(1/
φ
)+(2/
φ
) (second)·········(1)
ST: Executing number of execution states
Method 1 is recommended to operate for time efficiency.
(Method1)
1.Prohibit interrupt in interrupt handling routine (set IENFH, IENFL to "0").
2.After program process returned normal handling, clear interrupt request flags (IRRTFH,
IRRTFL) after more than time that calculated with (1) formula.
3.After read timer control status register F (TCSRF), clear timer overflow flags (OVFH, OVFL)
and compare match flags (CMFH, CMFL).
4.Operate interrupt permission (set IENFH, IENFL to “1”).
(Method2)
1.Set interrupt handling routine time to more than time that calculated with (1) formula.
2.Clear interrupt request flags (IRRTFH, IRRTFL) at the end of interrupt handling routine.
3.After read timer control status register F (TCSRF), clear timer overflow flags (OVFH, OVFL)
and compare match flags (CMFH, CMFL).
All above attentions are also applied in 16bit mode and 8bit mode.
2