English
Language : 

M16C80 Datasheet, PDF (227/358 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/80 SERIES
M16C/80 Group
27. Usage Precaution
Example 4)
ldipl #0
nop
nop
nop
; 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)
Example 5)
If rewriting the interrupt control register for interrupt B with the interrupt A routine and enabling multiple
interrupts with interrupt C, the above processing is required at the end of the interrupt A and interrupt
C routines.
Interrupt A routine
Interrupt_A:
pushm R0,R1,R2,R3,A0,A1
••••
bclr 3,TA0IC
••••
popm R0,R1,R2,R3,A0,A1
fclr U
pushm R0
mov.w 6[SP],R0
ldc R0,FLG
popm R0
nop
reit
; Store registers
; Rewrite interrupt control register of interrupt B
; Restore registers
; Select ISP (Unnecessary if the ISP has been selected)
; Store R0 register
; Read FLG on stack
; Set in FLG
; Restore R0 register
; Dummy
; Interrupt completed
Rev.1.00 Aug. 02, 2005 Page 216 of 329
REJ09B0187-0100