
ML62Q1000 Series User's Manual
Chapter 5 Interrupts
FEUL62Q1000
5-50
5.3.6.2 Description of Interrupt Function to Enable Multiple Interrupts
When describing an interrupt function to enable multiple interrupts, specify "2" in the category field in INTERRUPT
pragma and SWI pragma. Even if it is not specified in the category field, multiple interrupt are enabled. Built-in
function_EI can be called in an interrupt function to enable multiple interrupts.
Example of description
static void intr_fn_20 (void);
volatile unsigned short TM2msec;
#pragma interrupt intr_fn_20 0x20 2
static void intr_fn_20 (void)
{
_EI( );
/*Enable multiple interrupts*/
+;
_DI( );
/*Disable multiple interrupts*/
CIL = 0;
/*Clear the highest current interrupt request level*/
}
If described as in the example, intr_fn_20 ( ) is handled as an interrupt processing function to enable multiple interrupts.
CCU8 outputs the assembly code as shown below.
Example of output
_intr_fn_20 :
push
elr
,
epsw
push
er0
;; _EI( );
/*Enable multiple interrupts*/
ei
;; +;
l
er0, NEAR _TM2msec
add
er0, #1
st
er0, NEAR _TM2msec
;; _DI( );
/*Disable multiple interrupts*/
di
;;}
;; CIL = 0;
mov
r0,
#00h
st
r0,
0f022h
;;}
pop
er0
pop psw, pc
In an interrupt function to enable multiple interrupts, ELR and EPSW are saved in the stack so that they should not be
destroyed by multiple interrupts. This is the difference from the interrupt function to disable multiple interrupts. To
return from the interrupt function, "POP PSW, PC" is used instead of "RTI".
Содержание ML62Q1000 Series
Страница 17: ...Chapter 1 Overview...
Страница 112: ...Chapter 2 CPU and Memory Space...
Страница 154: ...Chapter 3 Reset Function...
Страница 166: ...Chapter 4 Power Management...
Страница 196: ...Chapter 5 Interrupts...
Страница 248: ...Chapter 6 Clock generation Circuit...
Страница 274: ...Chapter 7 Low Speed Time Base Counter...
Страница 291: ...Chapter 8 16 Bit Timer...
Страница 320: ...Chapter 9 Functional Timer FTM...
Страница 382: ...Chapter 10 Watchdog Timer...
Страница 402: ...Chapter 11 Serial Communication Unit...
Страница 456: ...Chapter 12 I2 C Bus Unit...
Страница 491: ...Chapter 13 I2 C Master...
Страница 512: ...Chapter 14 DMA Controller...
Страница 531: ...Chapter 15 Buzzer...
Страница 550: ...Chapter 16 Simplified RTC...
Страница 559: ...Chapter 17 GPIO...
Страница 594: ...Chapter 18 External Interrupt Function...
Страница 612: ...Chapter 19 CRC Generator...
Страница 632: ...Chapter 20 Analog Comparator...
Страница 644: ...Chapter 21 D A Converter...
Страница 655: ...Chapter 22 Voltage Level Supervisor...
Страница 676: ...Chapter 23 Successive Approximation Type A D Converter...
Страница 709: ...Chapter 24 Regulator...
Страница 714: ...Chapter 25 Flash Memory...
Страница 743: ...Chapter 26 Code Option...
Страница 750: ...Chapter 27 LCD Driver...
Страница 788: ...Chapter 28 On Chip Debug Function...
Страница 795: ...Chapter 29 Safety Function...
Страница 813: ...Appendix A...
Страница 881: ...Revision History...