跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

Is it the same when 1st interrupt is completed and the 2nd executed?

Latest Updated:02/14/2006

Question:

When an interrupt request is generated during another interrupt process, if the priority of the second interrupt is higher than that of the interrupt in process, I want to arrange it so that the interrupt in process is stopped, and the second interrupt process is executed. In the same manner, if the priority level of the interrupt in process is higher than that of the second interrupt, I want the first interrupt process to be completed, then the second interrupt process executed. Is there some way to do this?

Answer:

M16C Family has the interrupt priority level to control the interrupt process. When an interrupt request is generated, the priority level of the interrupt is compared with the processor interrupt priority level (IPL) in the flag register. If the priority level number of the generated interrupt is larger than the IPL number, the current process should be stopped and the newer interrupt process executed. If the IPL is larger, the new interrupt process is put in the wait state.

For example, assume Timer A0 is set to priority level "1", A/D Conversion to "3", and Timer A1 to "2". In this situation, when a Timer A1 interrupt is accepted, the IPL will be "2". If a Timer A0 interrupt request is generated during the Timer A1 interrupt process, because the Timer A0 interrupt priority level is only "1", the Timer A0 interrupt will go into the wait state.
Continuing on with the same example, if an A/D Conversion interrupt request is generated with interrupt priority level "3", its interrupt process will be executed immediately. After the A/D Conversion interrupt process is completed, the flow returns the Timer A1 interrupt (level "2"). After the Timer A1 interrupt process is completed, the Timer A0 interrupt (level "1"), which has been in the wait state, is finally executed.

Finally, when an interrupt request is accepted, the interrupt enable flag (I) goes to the interrupt disable state ("0"). To accept another interrupt during the current interrupt process, you need to set the I flag to interrupt enable state ("1") by software.

Suitable Products
M32C/8A
M32C/88
M32C/87
M32C/85
M32C/84
M32C/83
M32C/80
M16C/62A
M16C/62A(M16C/62T)
M16C/62M
M16C/62N
M16C/62N(M3062GF8NFP, M3062GF8NGP)
M16C/62P
M16C/63
M16C/64A
M16C/64C
M16C/65
M16C/65C
M16C/6C
M16C/6N4, M16C/6N5
M16C/6NK, M16C/6NL, M16C/6NM, M16C/6NN
M16C/5L, M16C/56
M16C/5LD, M16C/56D
M16C/5M, M16C/57
M16C/30P
M16C/29
M16C/28
M16C/26A
M16C/1N