LAPIS Semiconductor ML62Q1000 Series User Manual page 245

Table of Contents

Advertisement

In the interrupt function, the register (here, only ER0) that may be used in the interrupt routine is saved in the stack.
"RTI" instruction is used to return from the interrupt function to disable multiple interrupts.
The example below shows how to call other functions from an interrupt function.
Example of description
static void intr_fn_10 (void);
#pragma interrupt intr_fn_10 0x10 1
void func (void);
static void intr_fn_10 (void)
{
func ( );
CIL = 0;
}
Example of output
_intr_fn_10
push
push
l
push
;; func();
bl
;;}
;; CIL = 0;
mov
st
;;}
pop
st
pop
pop
rti
When another function is called from an interrupt function, the output code becomes redundant compared with the case
where another function is not called from the interrupt function. Thus the processing time of the interrupt becomes also
longer. This is because CCU8 does not know which registers the function func ( ) should use and it save the all registers
that may be changed by calling the func ( ) in the stack.
[Note]
Ÿ
Do not enable interrupts in a function called from a function for which multiple interrupts are disabled.
Otherwise, the program may run out of control when the multiple interrupts occur.
FEUL62Q1000
/*Clear the highest current interrupt request level*/
:
lr,
ea
xr0
r0,
DSR
r0
_func
r0,
#00h
r0,
0f022h
r0
r0,
DSR
xr0
ea,
lr
ML62Q1000 Series User's Manual
Chapter 5 Interrupts
5-49

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents