English
Language : 

M16C80 Datasheet, PDF (226/358 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/80 SERIES
M16C/80 Group
27. Usage Precaution
Interrupts
(1) Setting the stack pointer
• The value of the stack pointer is initialized to 00000016 immediately after reset. Accepting an
interrupt before setting a value in the stack pointer may cause runaway. Be sure to set a value in
the stack pointer before accepting an interrupt.
_______
When using the NMI interrupt, initialize the stack pointer at the beginning of a program. Regard-
_______
ing the first instruction immediately after reset, generating any interrupts including the NMI inter-
rupt is prohibited.
Set an even address to the stack pointer so that operating efficiency is increased.
_______
(2) The NMI interrupt
_______
• As for the NMI interrupt pin, an interrupt cannot be prohibited. Connect it to the VCC pin via a
resistance (pulled-up) if unused.
_______
• The NMI pin also serves as P85, which is exclusively input. Reading the contents of the P8
register allows reading the pin value. Use the reading of this pin only for establishing the pin level
_______
at the time when the NMI interrupt is input.
_______
• Signals input to NMI pin require "L" level and "H" level of 2 clock + 300ns or more, from the
operation clock of CPU.
(3) Address match interrupt
• Do not set the following addresses to the address match interrupt register.
1. The address of the starting instruction in an interrupt routine.
2. Any of the next 7 instructions addresses immediately after an instruction to clear an interrupt
request bit of an interrupt control register or an instruction to rewrite an interrupt priority level to
a smaller value.
3. Any of the next 3 instructions addresses immediately after an instruction to set the interrupt
enable flag (I flag).
4. Any of the next 3 instructions addresses immediately after an instruction to rewrite a processor
interrupt priority level (IPL) to a smaller value.
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
nop
; 4th instruction Do not set address match interrupt
nop
; 5th instruction during this period
nop
; 6th instruction
nop
; 7th instruction
Example 3)
fset I ; Set I flag ( interrupt enabled)
nop
; 1st instruction
nop
; 2nd instruction Do not set address match interrupt
nop
; 3rd instruction during this period
Rev.1.00 Aug. 02, 2005 Page 215 of 329
REJ09B0187-0100