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

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

Advertisement

10.7

Program Example for External Interrupt Circuit 1

An example of programming external interrupt circuit 1 is given below.
External Interrupt Circuit 1 Programming Example
● Processing specification
External interrupt circuit 1 detects the rising edge of a pulse input to the INT10 pin and generates an
interrupt.
● Coding example
DDR3
EIC1
TCR2
ILR1
EIR0
SL01
SL00
EIE0
INT_V
IRQ1
INT_V
;------------------------Main program--------------------------------------------------------------------------------
;------------------------Interrupt processing routing----------------------------------------------------------------
WARI
EQU
000DH
EQU
0024H
EQU
0020H
EQU
007BH
EQU
EIC1:3
EQU
EIC1:2
EQU
EIC1:1
EQU
EIC1:0
DSEG
ABS
ORG
0FFFAH
DW
WARI
ENDS
CSEG
:
CLRI
CLRB
EIR1
MOV
TCR2,#00000000B
MOV
DDR3,#00000000B ; Set P34 to serve inputs only.
MOV
ILR1,#11111110B
CLRB
SL01
SETB
SL00
CLRB
EIR0
SETB
EIE0
SETI
:
CLRB
EIE0
PUSHW
A
XCHW
A,T
CHAPTER 10 EXTERNAL INTERRUPT CIRCUIT 1 (EDGE)
; Address of port data direction register (DDR)
; External interrupt control register 1
; Address of 8/16-bit capture timer output control
register
; Setting of interrupt level setting register 1
; Definition of external interrupt request flag bit
; Definition of edge polarity selection bits
; Definition of edge polarity selection bits
; Definition of interrupt request enable bit
; [DATA SEGMENT]
; Interrupt vector (INT1) setting
; [CODE SEGMENT]
; Stack pointer (SP) is assumed to have been initialized.
;
; Disable interrupts.
; Clear external interrupt request flag.
; Set pin P34/TO/INT10 to serve port inputs.
; Set interrupt level at 2.
; Select rising edge.
;
; Clear external interrupt request flag.
; Enable interrupt request outputs.
; Enable interrupts.
; Clear external interrupt request flag (INT0).
241

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-8l mb89202Mb89202/f202ra series

Table of Contents