MB95630H Series
MN702-00009-1v0-E
FUJITSU SEMICONDUCTOR LIMITED
453
CHAPTER 21 MULTI-PULSE GENERATOR
21.8 Sample Program for Multi-pulse Generator
MOVW
PCNT1,A
;Enables PPG output in normal polarity
;Enables 16-bit PPG timer
;Software triggers PPG
;Select PWM mod
;Clears interrupt flag, and starts counter
MOVW
A,#0103H
MOVW
OPCR,A
;Enable OPT0 and OPT1 output
;Sets OPDBRH0/OPDBRL0 write method for data
transfer
;Enable write timing interrupt
;Clears interrupt flag
MOVW
A,#0009H
MOVW
OPDBR0,A
;Sets OPT0 pin as PPG output
;Sets OPT1 pin as inverted PPG output
;Starts data transfer
SETI
;Interrupt enable
LOOP:
MOV
A,#00H
;Endless loop
MOV
A,#01H;
JMP
LOOP;
;-------Interrupt program-------------------------------------------------------------------------------------
WARI:
CLRB
WTIF
;Clears interrupt request flag
; ;
; User processing
; :
RETI
;Returns from interrupt
CODE ENDS
;-------Vector setting------------------------------------------------------------------------------------------
VECT
CSEG
ABS
ORG
0FFDAH
;Sets vector for interrupt #16 (0x10)
DW WARI
ORG
0FFFCH
;Sets reset vector
DW 0000H
;Sets single-chip mode
DW START
VECT ENDS
END
START
END