
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.
Summary of Contents for ML610471
Page 12: ...Chapter 1 Overview...
Page 38: ...Chapter 2 CPU and Memory Space...
Page 44: ...Chapter 3 Reset Function...
Page 48: ...Chapter 4 MCU Control Function...
Page 62: ...Chapter 5 Interrupts...
Page 82: ...Chapter 6 Clock Generation Circuit...
Page 94: ...Chapter 7 Time Base Counter...
Page 105: ...Chapter 8 Capture...
Page 114: ...Chapter 9 Timer...
Page 133: ...Chapter 10 Watchdog Timer...
Page 141: ...Chapter 11 UART...
Page 164: ...Chapter 12 Port 0...
Page 173: ...Chapter 13 Port 2...
Page 180: ...Chapter 14 Port 3...
Page 188: ...Chapter 15 Port 4...
Page 199: ...Chapter 16 Port 6...
Page 205: ...Chapter 17 RC Oscillation Type A D Converter...
Page 225: ...Chapter 18 LCD Drivers...
Page 243: ...Chapter 19 Power Supply Circuit...
Page 245: ...Chapter 20 uEASE Flash Writer System...
Page 249: ...Chapter 21 Software Development...
Page 258: ...Appendixes...
Page 280: ...Revision History...