beautypg.com

FUJITSU F2MCTM-16LX User Manual

Page 353

background image

337

CHAPTER 17 DTP/EXTERNAL INTERRUPTS

;

;---------Main program-------------------------------------

CODE CSEG

START: ;Stack pointer (SP) already initialized

MOV I:ADER5,#00000000B ;Set analog input of port5 to disable

MOV I:ADER6,#00000000B ;Set analog input of port6 to disable

MOV I:DDR6,#11111111B ;Set DDR6 to output port

MOV I:DDR5,#00000000B ;Set DDR5 to input port

AND CCR,#0BFH ;Interrupts disabled

MOV I:ICR07,#08H ;Interrupt level 0 (highest) EI

2

OS

;Channel 0

;Data bank register (DTB) = 00H

MOV BAPL,#00H ;Address for storing output data set

MOV BAPM,#06H ;(600

H

to 60A

H

used)

MOV BAPH,#00H

MOV ISCS,#12H ;Byte transfer, buffer address +1,

;I/O address fixed,

;transfer from memory to I/O

MOV IOAL,#00H ;Set port 0 as transfer destination

MOV IOAH,#00H ;address pointer

MOV DCTL,#0AH ;Set transfer count to 10

MOV DCTH,#00H

;

CLRB I:EN8 ;INT8 disabled using ENIR1

MOV I:ELVR1L,#00000001B;H level detection set for INT8

CLRB I:ER8 ;INT8 interrupt request flag cleared

;using EIRR1

SETB I:EN8 ;INT8 interrupt request enabled using

ENIR1

MOV ILM,#07H ;Set ILM in PS to level 7

OR CCR,#40H ;Interrupts enabled

LOOP:

ÅE

Processing by user

ÅE

BRA LOOP

;---------Interrupt program-------------------------------------

WARI:

CLRB I:ER8 ;INT8 interrupt request flag cleared

ÅE

Processing by user

ÅE

RETI ;Return from interrupt processing

CODE ENDS

;---------Vector setting------------------------------------------

VECT CSEG ABS=0FFH

ORG 00FF94H ;Set vector to interrupt number