Program Example For The External Interrupt Circuit - Fujitsu Semiconductor Controller MB89950/950A Hardware Manual

F2mc-8l 8-bit microcontroller
Table of Contents

Advertisement

CHAPTER 11 EXTERNAL INTERRUPT CIRCUIT (EDGE)
11.6

Program Example for the External Interrupt Circuit

This section gives a program example for the external interrupt circuit.
I Program example for the external interrupt circuit
G
Processing description
• Generates interrupts on detecting a rising edge on pulses input to the INT1 pin.
G
Coding example
EIC1
EIR1
SL10
EIE1
ILR1
INT_V
IRQ1
INT_V
;-----Main program----------------------------------------------------------------
;-----Interrupt processing routine------------------------------------------------
WARI
;---------------------------------------------------------------------------------
232
EQU
0030H
EQU
EIC1:7
EQU
EIC1:5
EQU
EIC1:4
EQU
007CH
DSEG
ABS
ORG
0FFF8H
DW
WARI
ENDS
CSEG
:
CLRI
CLRB
EIR1
MOV
ILR1,#11110111B ; Set interrupt level (level 1).
SETB
SL10
SETB
EIE1
SETI
:
CLRB
EIE1
PUSHW
A
XCHW
A,T
PUSHW
A
:
User processing
:
POPW
A
XCHW
A,T
POPW
A
RETI
ENDS
END
; External interrupt control register 1
; Defines the external interrupt request flag bit.
; Defines the edge polarity selection bit.
; Defines the interrupt request enable bit.
; Set interrupt level setting register 1.
; [DATA SEGMENT]
; Set INT1 interrupt vector.
; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
; Disable interrupts.
; Clear interrupt request flag.
; Select rising edge.
; Enable output of interrupt requests.
; Enable interrupts.
; Clear INT1 interrupt request flag.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb89950 seriesMb89950a series

Table of Contents