Program Example Of Dtp/External Interrupt Function - Fujitsu MB90895 Series Hardware Manual

16 bit, controller manual
Table of Contents

Advertisement

12.6

Program Example of DTP/External Interrupt Function

This section gives a program example of the DTP/external interrupt function.
I Program Example of DTP/External Interrupt Function
G
Processing specification
An external interrupt is generated by detecting the rising edge of the pulse input to the INT4 pin.
G
Coding example
ICR06
EQU
0000B6H
DDR2
EQU
000012H
ENIR
EQU
000030H
EIRR
EQU
000031H
ELVRL
EQU
000032H
ELVRH
EQU
000033H
ER0
EQU
EIRR:0
EN0
EQU
ENIR:0
;
;---------Main program-------------------------------------
CODE
CSEG
START:
MOV
I:DDR2,#00000000B
AND
CCR,#0BFH
MOV
I:ICR06,#00H
CLRB
I:EN4
MOV
I:ELVRL,#00000010B ;INT4 is rising edge selection
CLRB
I:ER4
SETB
I:EN4
MOV
ILM,#07H
OR
CCR,#40H
LOOP:
User processing
BRA
LOOP
;---------Interrupt program-------------------------------------
WARI:
CLRB
User processing
RETI
CODE
ENDS
;---------Vector setting-----------------------------------------
VECT
CSEG
ABS=0FFH
ORG
00FFC0H
DSL
WARI
ORG
00FFDCH
DSL
START
DB
00H
VECT
ENDS
END
START
I:ER4
;DTP/external interrupt control register
;Port 2 direction register
;DTP/external interrupt enable register
;DTP/external interrupt factor register
;Detection level setting register: L
;Detection level setting register: H
;INT4 interrupt request flag bit
;INT4 interrupt request flag bit
;Stack pointer (SP),already initialized
;Setting DDR2 to input port
;Interrupt disabled
;Interrupt level 0 (highest)
;Disable INT4 at ENIR
;Interrupt request flag of INT4 in EIRR
;Clear
;Interrupt request enabled of INT4 in ENIR
;Setting ILM in PS to level 7
;Interrupts enabled
;Clear interrupt request flag
;Recovery from interrupt processing
;Setting vector to interrupt number #15(0F
;Reset vector setting
;Set to single chip mode
CHAPTER 12 DTP/external interrupt
)
H
345

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lx

Table of Contents