Program Example For External Interrupt Circuit 2 - Fujitsu F2MC-8L F202RA Hardware Manual

F2mc-8l 8-bit microcontroller
Hide thumbs Also See for F2MC-8L F202RA:
Table of Contents

Advertisement

CHAPTER 11 EXTERNAL INTERRUPT CIRCUIT 2 (LEVEL)
11.7

Program Example for External Interrupt Circuit 2

An example of programming external interrupt circuit 2 is given below.
Program Example for External Interrupt Circuit 2
● Processing specification
The external interrupt circuit 2 detects an "L" level signal input to the P00/INT20/AN4 pin and generates
an interrupt.
● Coding example
DDR0
ADEN EQU
EIE2
EIF2
IF20
ILR3
INT_V DSEG
IRQA
INT_V ENDS
;------------------------Main program--------------------------------------------------------------------------------
CSEG
CLRI
CLRB
MOV
MOV
MOV
MOV
SETI
;------------------------Interrupt processing routine----------------------------------------------------------------
WARI MOV
256
EQU
0001H
0034H
EQU
0036H
EQU
0037H
EQU
EIF2:0
EQU
007DH
ABS
ORG
0FFE6H
DW
WARI
:
IF20
ILR2,#11111110B
DDR0,#00000000B
ADEN,#00000000B
EIE2,#00000001B
:
EIE2,#00000000B
CLRB
IF20
; Address of the port data direction register
; Address of the A/D enable register
; Address of the external interrupt 2 control register
; Address of the external interrupt 2 flag register
; Definition of the external interrupt request flag bit
; Address of the interrupt level setting register
; [DATA SEGMENT]
; Interrupt vector setting
; [CODE SEGMENT]
; Stack pointer (SP) is assumed to have been initialized.
;
; Disable interrupts.
; Clear external interrupt request flag.
; Set interrupt level to 2.
; Set pin INT20/AN4 to serve inputs only.
; Set pin INT20/AN4 to enable external interrupt inputs.
; Enable external interrupt inputs to pin INT20/AN4.
; Enable interrupts.
; Disable external interrupt inputs to pin INT20/AN4.
; Clear external interrupt request flag.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-8l mb89202Mb89202/f202ra series

Table of Contents