
ML62Q1000 Series User's Manual
Chapter 5 Interrupts
FEUL62Q1000
5-44
A-2-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 LR, ELR, EPSW, LR" to save the interrupt return address, the subroutine return address,
and the EPSW1 status in the stack.
• Processing at the end of interrupt routine execution
Specify "POP PSW, PC, LR", instead of the RTI instruction, to return the saved data of the interrupt return
address to PC, the saved data of EPSW1 to PSW, and the saved data of LR to LR.
• 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 of description:
Status A-2-2
For assembly language:
Intrpt_A-2-2;
; Start
PUSH ELR, EPSW, LR
; Save ELR, EPSW, and LR at
the beginning
:
EI
; Enable interrupt
:
Sub_1;
;
:
DI
; Disable interrupt
:
:
:
BL Sub_1
; Call subroutine Sub_1
EI
; Enable interrupt
:
RT
; Return PC from LR
POP PSW, PC, LR
; Return PC from the stack
; End of subroutine
; Return PSW from the stack
; Return LR from the stack
; End of interrupt routine
For C language:
static void Intrpt_A_2_2(void);
#pragma interrupt Intrpt_A_2_2 0x22 2
static void Intrpt_A_2_2(void)
{
:
_EI();
/* Enable interrupt */
:
Sub_1();
/* Call subroutine Sub_1 */
:
}
/* End of interrupt routine */
void Sub_1(void)
{
_DI();
/* Disable interrupt */
:
_EI();
/* Enable interrupt */
}
/* End of subroutine */
Содержание 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...