Pular para o conteúdo principal
Knowledgebase
Home
Renesas Brasil - Knowledgebase

How to Clear Request Flag

Last Updated:05/25/2018

Question:

When the interrupt request flag is cleared, other interrupt requests are no longer accepted. How should the request flag be cleared?

Answer:

Q: Question
In development using the C programming language, when we cleared the request flag using a description such as IF0 &= 0xfe;, the request flags of other bits of the same register were set during the time between reading and writing. Afterwards, these flags were cleared again during a write operation and interrupt requests could no longer be accepted.
So we changed the clearing operation to a bit manipulation instruction  __asm("clr1 IF0,0"); and the operation could be accepted without any problem. Was this simply a matter of probability?
Since a FAQ contained some reference about a bit manipulation instruction resulting in a read-modify-write operation, it does not seem to be a simple matter of lowered probability.

A: Answer
It is not a matter of probability, and using a bit manipulation instruction eliminates the problem.

Suitable Products
RL78/G10
RL78/G11
RL78/G12
RL78/G13
RL78/G14
RL78/G1A
RL78/G1C
RL78/G1D
RL78/G1E
RL78/G1F
RL78/G1G
RL78/G1H
RL78/I1A
RL78/I1C
RL78/I1D
RL78/I1E
RL78/L12
RL78/L13
RL78/L1A
RL78/L1C
78K Family