English
Language : 

M16C80 Datasheet, PDF (87/358 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/80 SERIES
M16C/80 Group
9. Interrupt Outline
Example 1)
Interrupt_A:
; Interrupt A routine
pushm R0,R1,R2,R3,A0,A1 ; <---- Do not set address match interrupt to the
••••
;
start address of an interrupt instruction
Example 2)
mov.b #0,TA0IC
;Change TA0 interrupt priority level to a smaller value
nop
; 1st instruction
nop
; 2nd instruction
nop
; 3rd instruction Do not set address match interrupt
nop
; 4th instruction during this period
nop
; 5th instruction
nop
; 6th instruction
nop
; 7th instruction
Example 3)
fset I
nop
nop
nop
Example 4)
ldipl #0
nop
nop
nop
; Set I flag ( interrupt enabled)
; 1st instruction
; 2nd instruction
; 3rd instruction
Do not set address match interrupt
during this period
; Rewrite IPL to a smaller value
; 1st instruction
; 2nd instruction
; 3rd instruction
Do not set address match interrupt
during this period
• To return from an interrupt to the address set in an address match interrupt register using return
instruction (reit or freit)
To rewrite the interrupt control register within the interrupt routine, add the below processing to the
end of the routine (immediately before the reit or freit instruction). Also, if multiple interrupts are
enabled with other interrupts, add the below processing to the end of the interrupt that enables the
multiple interrupts.
If the interrupt control register is being rewritten within the non-maskable interrupt routine, add the
below processing to the end of all interrupts.
Additional process
fclr U
pushm R0
mov.w 6[SP],R0
ldc R0,FLG
popm R0
nop
reit
; Execute after the register reset instruction (popm instruction)
; Select ISP (Unnecessary if the ISP has been selected)
; Store R0 register
; Read FLG on stack (use "stc SVF,R0" when high-speed
;
interrupt)
; Set in FLG
; Restore R0 register
; Dummy
; Interrupt completed (use freit when high-speed interrupt)
Rev.1.00 Aug. 02, 2005 Page 76 of 329
REJ09B0187-0100