Skip to main content
Renesas Singapore - Knowledgebase

What to do when supporting 4 or 5 different interrupts?

Latest Updated:12/01/2011


When there are three or fewer interrupt functions, I think that it is all right to assign each interrupt to register banks RB1 to 3, respectively; but what should I do when supporting 4 or 5 different interrupts? (Register save, etc.)


There is no need to allocate all the interrupts to a different register bank.
The approach differs depending on whether or not you want to use multiple interrupts (nesting).

Even if you plan on using several interrupts, as long as you will not use multiple interrupts, it is sufficient to use one register bank for the main processing, and one register bank for the interrupt servicing.
(Since no interrupt will be serviced while another interrupt is being serviced, the same register bank can be shared for different interrupts.)

If, using multiple interrupts, it is necessary to acknowledge an interrupt during the servicing of another interrupt, different register banks must be used for these interrupts.

In this case, allocate the register banks for that interrupt combination so that there is no conflict.
If there are many nested levels and they cannot be handled by the register banks, do not use the register banks for the lower priority interrupts, and instead save the registers to the stack area.

This processing is automatically performed by not describing register bank specification (and not specifying NOBANK) when using the #pragma interrupt command for interrupt definition.

For details, refer to the explanation in section
"(10) Interrupt function qualifier" in "11.5 How to Use Extended Functions" in CHAPTER 11 EXTENDED FUNCTIONS in the CC78K0 (Language) manual.

Suitable Products
RL78 Family
78K Family