Sample Program For Multi-Pulse Generator - Fujitsu MB95630H Series Hardware Manual

8-bit microcontroller new 8fx
Hide thumbs Also See for MB95630H Series:
Table of Contents

Advertisement

CHAPTER 21 MULTI-PULSE GENERATOR

21.8 Sample Program for Multi-pulse Generator

21.8
Sample Program for Multi-pulse Generator
This section provides a sample program for the multi-pulse generator.
■ Sample Program for Multi-pulse Generator
● Processing
An output in the PPG is directed to OPT0 and an inverted output in the PPG is directed to
OPT1 when write timing interrupt is generated.
The OPDBRH0/OPDBRL0 write method is used for data transfer to 16-bit MPG output
data register (upper/lower) (OPDUR/OPDLR).
The 16-bit PPG timer is used in PWM and is started with a software trigger.
16 MHz is used for the machine clock, and 62.5 ns is used for the count clock of the 16-bit
PPG timer.
● Coding example
;-------A demo program--------------------------------------------------------------------------------------
ILR4
PCSR1
PDUT1
PCNT1
OPCUR
OPCLR
OPCR
OPDBRH0
OPDBRL0
OPDBR0
WTIF
;-------Main program-----------------------------------------------------------------------------------------
CODE
START:
;
452
EQU
007DH
EQU
0FB2H
EQU
0FB4H
EQU
0044H
EQU
0066H
EQU
0067H
EQU
OPCUR
EQU
0FC4H
EQU
0FC5H
EQU
OPDBRH0
EQU
OPCUR:1
CSEG
ABS
:
CLRI
MOV
ILR4,#00H
MOVW A,#0064H
MOVW PCSR1,A
MOVW A,#003CH
MOVW PDUT1,A
MOVW A,#01100000000000110B
FUJITSU SEMICONDUCTOR LIMITED
MB95630H Series
;Interrupt control register for the waveform sequencer
;16-bit PPG cycle setting buffer register
;16-bit PPG duty setting buffer register
;16-bit PPG status control register
;16-bit MPG output control register (upper)
;16-bit MPG output control register (lower)
;16-bit MPG output control register (upper+lower)
; ,for word access.
;16-bit MPG output data buffer register 0 (upper)
;16-bit MPG output data buffer register 0 (lower)
;16-bit MPG output data buffer register 0
(upper+lower)
; ,for word access.
;Interrupt request flag bit
;Assumes that stack pointer (SP) has already been
;Interrupt disable
;Interrupt level 0 (top priority)
;Sets the period of the PPG output
;Sets the duty ratio of the PPG output
MN702-00009-1v0-E

Advertisement

Table of Contents
loading

Table of Contents