
ML610471/472/473/Q471/Q472/Q473 User's Manual
Chapter 5 Interrupt
5-16
5.3.4 Notes on Interrupt Routine
Notes are different in programming depending on whether a subroutine is called or not by the program in executing an
interrupt routine, whether multiple interrupts are enabled or disabled, and whether such interrupts are maskable or
non-maskable.
Status A: Maskable interrupt is being processed
A-1: When a subroutine is not called by the program in executing an interrupt routine
A-1-1: When multiple interrupts are disabled
•Processing immediately after the start of interrupt routine execution
No specific notes.
•Processing at the end of interrupt routine execution
Specify the RTI instruction to return the contents of the ELR register to the PC and those of the EPSW
register to PSW.
A-1-2: When multiple interrupts are enabled
•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 before the master interrupt enable(MIE) bit is set
Specify “RB Exx” to invalidate the accepted interrupt. (Exx: the accepted interrupt enable flag)
•Processing at the end of interrupt routine execution
Specify “DI” not to execute the same interrupt routine.
Specify “SB Exx” to validate the accepted interrupt. (Exx: the accepted interrupt enable flag)
Specify “POP PC, PSW” instead of the RTI instruction to return the contents of the stack to PC and
PSW.
Example of description:
Status A-1-1
Example of description: Status
A-1-2
Intrpt_A-1-1;
; A-1-1 state
Intrpt_A-1-2; ;
Start
DI
; Disable interrupt
PUSH LR,EPSW
; Save ELR and EPSW at the
beginning
:
:
:
RB Exx
; Invalidate the accepted interrupt
(*1)
:
EI
; Enable interrupt (*2)
RTI
; Return PC from ELR
:
; Return PSW form
EPSW
:
;
End
DI
; Disable interrupt
SB Exx
; Validate the accepted interrupt
POP PC,PSW
; Return PC from the stack
; Return PSW from the stack
;
End
(*1) When multiple interrupts are enabled, please set the accepted interrupt enable flag to “0” to prevent
the occurrence of the accepted interrupt.
(*2) After enabling interrupt, not only a higher-priority interrupt than the accepted interrupt but also a
lower-priority interrupt than that occurs.
Содержание ML610471
Страница 12: ...Chapter 1 Overview...
Страница 38: ...Chapter 2 CPU and Memory Space...
Страница 44: ...Chapter 3 Reset Function...
Страница 48: ...Chapter 4 MCU Control Function...
Страница 62: ...Chapter 5 Interrupts...
Страница 82: ...Chapter 6 Clock Generation Circuit...
Страница 94: ...Chapter 7 Time Base Counter...
Страница 105: ...Chapter 8 Capture...
Страница 114: ...Chapter 9 Timer...
Страница 133: ...Chapter 10 Watchdog Timer...
Страница 141: ...Chapter 11 UART...
Страница 164: ...Chapter 12 Port 0...
Страница 173: ...Chapter 13 Port 2...
Страница 180: ...Chapter 14 Port 3...
Страница 188: ...Chapter 15 Port 4...
Страница 199: ...Chapter 16 Port 6...
Страница 205: ...Chapter 17 RC Oscillation Type A D Converter...
Страница 225: ...Chapter 18 LCD Drivers...
Страница 243: ...Chapter 19 Power Supply Circuit...
Страница 245: ...Chapter 20 uEASE Flash Writer System...
Страница 249: ...Chapter 21 Software Development...
Страница 258: ...Appendixes...
Страница 280: ...Revision History...