Program Example For External Interrupt Circuit - Fujitsu F2MC-8L MB89620 Series Hardware Manual

8-bit microcontroller
Table of Contents

Advertisement

6
12.

Program Example for External Interrupt Circuit

This section gives a program example for the external interrupt circuit.
n Program Example for External Interrupt Circuit
l
Processing description
Coding example
l
EIC1
EIR1
SEL1
EIE1
ILR1
INT_V
IRQ1
INT_V
;-----Main program----------------------------------------------------------------------------------------------------------------------------------------
;-----Interrupt processing routine----------------------------------------------------------------------------------------------------------------------
WARI
;---------------------------------------------------------------------------------------------------------------------------------------------------------------
242
CHAPTER 12 EXTERNAL INTERRUPT CIRCUIT (EDGE)
Generates interrupts on detecting a rising edge on pulses input to the INT1 pin.
EQU
0024H
EQU
EIC1:7
EQU
EIC1:5
EQU
EIC1:4
EQU
007CH
DSEG
ABS
ORG
0FFFAH
DW
WARI
ENDS
CSEG
:
CLRI
CLRB
EIR1
MOV
ILR1,#11110111B
CLRB
SEL1
SETB
EIE1
SETI
:
CLRB
EIR1
PUSHW
A
XCHW
A,T
PUSHW
A
:
User processing
:
POPW
A
XCHW
A,T
POPW
A
RETI
ENDS
END
; Address of the external interrupt 1 control register
; Define the external interrupt request flag bit.
; Define the edge polarity selection bit.
; Define the interrupt request enable bit.
; Address of the set interrupt level setting register 1
; [DATA SEGMENT]
; Set interrupt vector.
; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
; Disable interrupts.
; Clear interrupt request flag.
; Set interrupt level (level 1).
; Select rising edge.
; Enable interrupt request output.
; Enable interrupts.
; Clear external interrupt request flag.
MB89620 series

Advertisement

Table of Contents
loading

Table of Contents