Program Example Of Dtp/External Interrupt Function - Fujitsu F2MCTM-16LX Hardware Manual

16-bit microcontroller
Table of Contents

Advertisement

17.6

Program Example of DTP/External Interrupt Function

This section gives a program example of the DTP/external interrupt function.
Program Example of DTP/External Interrupt Function
Processing specifications
An external interrupt is generated by detecting the rising edge of the pulse input to the INT8 pin.
Coding example
ICR07
DDR5
ENIR1
EIRR1
ELVR1L EQU
ELVR1H EQU
ADER5
ER8
EN8
;---------Main program-------------------------------------
CODE
START:
LOOP:
;---------Interrupt program-------------------------------------
WARI:
EQU
0000B7H
EQU
000015H
EQU
0000CAH
EQU
0000CBH
0000CCH
0000CDH
EQU
00000BH
EQU
EIRR1:0
EQU
ENIR1:0
CSEG
;Stack pointer (SP) already initialized
MOV
I:ADER5,#00000000B ;Set analog input of Port5 to disable
MOV
I:DDR5,#00000000B
AND
CCR,#0BFH
MOV
I:ICR07,#00H
CLRB
I:EN8
MOV
I:ELVR0L,#00000010B;Rising edge selected for INT8
CLRB
I:ER0
SETB
I:EN8
MOV
ILM,#07H
OR
CCR,#40H
ÅE
Processing by user
ÅE
BRA
LOOP
CLRB
I:ER8
CHAPTER 17 DTP/EXTERNAL INTERRUPTS
;Interrupt control register ICR7
;Port 5 direction register
;DTP/external interrupt enable
register 1
;DTP/external interrupt factor
register 1
;Detection level setting register 1:"L"
;Detection level setting register 1:"H"
;Port5 analog input enable register
;INT8 Interrupt request flag bit
;INT8 Interrupt request enable bit
;Set DDR5 to input port
;Interrupts disabled
;Interrupt level 0 (highest)
;INT8 disabled using ENIR1
;INT8 interrupt flag cleared using
;EIRR1
;INT8 interrupt request enabled using
ENIR1
;Set ILM in PS to level 7
;Interrupts enabled
;Interrupt request flag cleared
335

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the F2MCTM-16LX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mb90360 series

Table of Contents

Save PDF