Sample Program Of Interrupt Processing - Fujitsu MB90480 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 3 INTERRUPT

3.10 Sample Program of Interrupt Processing

A sample program for interrupt processing is shown below.
Sample program for interrupt processing
❍ Processing specification
An example of an interrupt program using external interrupt 0 (INT0) is shown.
Sample coding from the program is shown below.
[Coding example]
DDR1
ENIR
EIRR
ELVR
ICR00
STACK
STACK_T RW
STACK
;-----------Main program----------------------------------------------------------
CODE
START:
LOOP:
;-----------Interrupt program--------------------------------------------
ED_INT1:
CODE
;-----------Vector setting--------------------------------------------------------
VECT
VECT
92
EQU
000011H
EQU
028H
EQU
029H
EQU
02AH
EQU
0B0H
SSEG
RW
100
1
ENDS
CSEG
MOV
RP,#0
MOV
ILM,#07H
MOV
A,#!STACK_T
MOV
SSB,A
MOVW
A,#STACK_T
MOVW
SP,A
MOV
DDR1,#00000000B
OR
CCR,#40H
MOV
I:ICR00,#00H
MOV
I:ELVR,#00000001B
MOV
I:EIRR,#00H
MOV
I:ENIR,#01H
:
NOP
NOP
NOP
NOP
BRA
LOOP
MOV
I:EIRR,#00H
NOP
NOP
NOP
NOP
NOP
NOP
RETI
ENDS
CSEG
ABS=OFFH
ORG
OFFDOH
DSL
ED_INT1
ORG
OFFDCH
DSL
START
DB
00H
ENDS
END
START
;Port 1 direction register
;Interrupt/DTP enable register
;Interrupt/DTP flag
;Request level set register
;Interrupt control register
;Stack
;General-purpose register use of
header bank
;PS:ILM is set to level 7
;Setting of system stack
;Setting of stack pointer, where
;it is set to SSP since S-flag = 1
;P10/INT0 pin is set to input
;I-flag in PS:CCR is set for interrupt enable
;Interrupt set to level 0 (highest)
;INT0 is set to H-level request
;INT0 interrupt factor cleared
;INT0 input enable
;Dummy loop
;Unconditional jump
;Prohibition of acceptance of new
;INT0
;Return from interrupt
;Vector is set to interrupt #11(0BH)
;Reset vector setting
;Set to single chip mode

Advertisement

Table of Contents
loading

Table of Contents