LAPIS Semiconductor ML62Q1000 Series User Manual page 238

Table of Contents

Advertisement

A-1-2: When multiple interrupts are enabled
• When the script is written in the assembly language
• Processing immediately after the start of interrupt routine execution
Specify "PUSH ELR, EPSW" to save the interrupt return address and the PSW status in the stack.
• Processing at the end of interrupt routine execution
Specify "POP PC, PSW" instead of the RTI instruction to return the contents of the stack to PC and PSW.
• When the script is written in C
Define the interrupt routine using the INTERRUPT pragma. Specify "2" in the category field. In this way,
appropriate codes are produced through the C compiler (CCU8).
Example
State A-1-2
For assembly language:
Intrpt_A-1-2;
PUSH ELR, EPSW
:
:
EI
:
POP PSW, PC
For C language:
static void Intrpt_A_1_2(void);
#pragma interrupt Intrpt_A_1_2 0x20 2
static void Intrpt_A_1_2(void)
{
_EI();
:
}
FEUL62Q1000
of
description:
; Start
; Save ELR and EPSW at the
beginning
; Enable interrupt
; Return PC from the stack
; Return PSW from the stack
; End of interrupt routine
/* Enable interrupt */
/* End of interrupt routine */
ML62Q1000 Series User's Manual
Chapter 5 Interrupts
5-42

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents