Hardware Interrupt Operation - Fujitsu F2MC-16LX Hardware Manual

Mb90470 series 16-bit microcontroller
Hide thumbs Also See for F2MC-16LX:
Table of Contents

Advertisement

CHAPTER 3 INTERRUPT
3.4.1

Hardware Interrupt Operation

This section explains an operation starting from hardware interrupt request generation
until completion of interrupt processing.
I Starting hardware interrupt
❍ Operation of peripheral function (generating an interrupt request)
The peripheral functions including hardware interrupt request functions have the "interrupt
request flag" to indicate whether or not to generate an interrupt request and "interrupt enable
flag" that selects whether to enable or disable an interrupt request to the CPU. The interrupt
request flag is set when a peripheral function specific event is generated, and it issues an
interrupt request to the interrupt controller if the interrupt enable flag is set to "enable".
❍ Operation of interrupt controller (control of interrupt request)
The interrupt controller compares interrupt levels (IL) in interrupt requests that are received at
one time, and selects the request of the highest level (the lowest value of IL) and notifies the
CPU of it. If multiple requests have the same level, the one with the lower interrupt number has
a priority.
❍ CPU operation (acceptance of interrupt requests and interrupt processing)
CPU compares the levels (ICR: IL2 to IL0) of received interrupts with the interrupt level mask
register (ILM). If IL < ILM and the interrupt is permitted (I = 1, in PC: CCR), the interrupt
processing microcode starts and interrupt processing is executed,after the instruction currently
being executed is completed.
Interrupt processing first saves the contents of a dedicated register (12 bytes of A, DPR, ADB,
DTB, PCB, PC and PS) in the system stack (system stack space indicated by SSB and SSP).
Then, it loads the interrupt vector to the program counter (PCB, PC), updates ILM, and sets the
stuffing (S) flag (i.e., sets the CCR S-flag to "1" and enables the system stack).
I Return from hardware interrupt
In the interrupt processing program, if the RETI instruction is executed and the interrupt request
flag of a peripheral function that is an interrupt factor is cleared, 12 bytes of the data stored in
the system stack is returned to the dedicated register to restart the processing in progress
before the interrupt branch. By clearing the interrupt request flag, the interrupt request that the
peripheral function output to the interrupt controller is automatically removed.
58

Advertisement

Table of Contents
loading

Table of Contents