5 operation, 1 interrupt sequence – Renesas SH7781 User Manual

Page 367

Advertising
background image

10. Interrupt Controller (INTC)

Rev.1.00 Jan. 10, 2008 Page 337 of 1658

REJ09B0261-0100

10.5

Operation

10.5.1

Interrupt Sequence

The sequence of interrupt operations is described below. Figure 10.4 shows a flowchart of the
operations.

1. Interrupt request sources send interrupt request signals to the INTC.

2. The INTC selects the interrupt with the highest priority among the interrupts that have been

sent, according to the priority set in INTPRI and INT2PRI0 to INT2PRI9. Lower priority
interrupts are held as pending interrupts. If two of the interrupts have the same priority level or
multiple interrupts are generated by a single module, the interrupt with the highest priority is
selected according to table 10.13.

3. The priority level of the interrupt selected by the INTC is compared with the interrupt mask

level (IMASK) set in SR of the CPU. Only the interrupt with a higher priority than the IMASK
bit is accepted, and an interrupt request signal is sent to the CPU.

4. The CPU accepts an interrupt at the next break between instructions.

5. The interrupt source code is set in the interrupt event register (INTEVT).

6. The SR and program counter (PC) are saved in SSR and SPC, respectively. At that time, R15

is saved in SGR.

7. The BL, MD, and RB bits in SR are set to 1.

8. Execution jumps to the start address of the interrupt exception handling routine (the sum of the

value set in the vector base register (VBR) and H'0000 0600).

In the exception handling routine, the value of INTEVT is branched as an offset. This easily
enables to branch the exception handling routine to handling routine for each interrupt source.

Notes: 1. When the INTMU bit in CPUOPM is set to 1, the interrupt mask level (IMASK) in SR

is automatically set to the level of the accepted interrupt. When the INTMU bit in
CPUOPM is cleared to 0, the value of the IMASK in SR is not affected by the accepted
interrupt.

2. The interrupt source flag should be cleared during exception handling routine. To

ensure that an interrupt source which should have been cleared is not erroneously
accepted again, read the interrupt source flag after it has been cleared, and wait for the
time shown in table 10.14. Then, clear the BL bit or execute an RTE instruction.

3. The IRQ interrupts, IRL interrupts, on-chip peripheral module interrupts are initialized

to the interrupt masking state by a power-on reset. Therefore, clear the interrupt
masking for each interrupt , INTMSK0, INTMSK1, and INT2MSKR by using
INTMSKCLR0, INTMSKCLR1, and INT2MSKCLR.

Advertising