Skip to main content
Knowledgebase
Home
Renesas Electronics America - Knowledgebase

Is the RETI instruction not executed when TMO is used as interval timer?

Latest Updated:03/21/2017

Question:

TM0 is used as an interval timer.
After startup, an interrupt occurred only once.
Is this because the RETI instruction was not executed at the end of the interrupt?

Answer:

Yes it is.
Judging from the contents of your question, the reason for this phenomenon may be, as you mentioned, that ISPR is not reset because RETI has not been executed.

In V850 devices, up to 8 priority levels can be set, and these settings are controlled in the ISPR register.
This 8-bit register consists of 8 bits that correspond to each priority level, and when an interrupt is acknowledged, the bit corresponding to that interrupt's priority level is set (to 1).

Once a bit in the ISPR register is set, only the interrupts with a priority level higher than the set bit are acknowledged.
When a RETI instruction is executed at the end of the interrupt servicing to exit interrupt servicing, the bit that corresponds to the highest-priority interrupt among all of those set to 1 in the ISPR register is cleared to 0.

Since the priority levels of interrupts are controlled in this way, a RETI instruction must be executed to end interrupt servicing.

Suitable Products
V850 Family