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

8-bit microcontroller
Hide thumbs Also See for F2MC-8L Series:
Table of Contents

Advertisement

10.7 Program Example for External Interrupt Circuit 1

This section gives a program example for the external interrupt circuit 1.
Program Example for External Interrupt Circuit 1
Processing description
Generates interrupts on detecting a rising edge on pulses input to the INT0 pin.
Coding example
DDR3
EQU
EIC1
EQU
ILR1
EQU
EIR0
EQU
SL01
EQU
SL00
EQU
EIE0
EQU
INT_V
DSEG
ORG
IRQ0
DW
INT_V
ENDS
;-----Main program-----------------------------------------------------------------------------------------------------------------------------------------
CSEG
:
CLRI
MOV
CLRB
MOV
CLRB
CLRB
SETB
000DH
0023H
007CH
EIC1:3
EIC1:2
EIC1:1
EIC1:0
ABS
0FFFAH
WARI
DDR3, #00000000B
EIR0
ILR1,#11111110B
SL01
SL00
EIE0
10.7 Program Example for External Interrupt Circuit 1
; Address of the port data detection register
; Address of the external interrupt 1 control register 1
; Address of the interrupt level setting register
; Define the external interrupt request flag bit.
; Define the edge polarity selection bit.
; Define the edge polarity selection bit.
; Define the interrupt request enable bit.
; [DATA SEGMENT]
; Set interrupt vector.
; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
; Disable interrupts.
; Set P34 for input. #XXX0XXXXB is valid.
; Clear interrupt request flag.
; Set interrupt level (level 2).
; Select rising edge.
;
; Enable interrupt request output.
243

Advertisement

Table of Contents
loading

Table of Contents