Sample Programs For The Multi-Pulse Generator - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

15.8

Sample Programs for the Multi-pulse Generator

This section contains sample programs for the Multi-pulse Generator.
■ Sample Program for the Multi-pulse Generator
Processing
• An output in PPG is directed to OPT0 and an inverted output in PPG is directed to OPT1 when write
timing interrupt is generated.
• OPDBR0 write method is used for data transfer to output data register OPDR.
• The 16-bit PPG timer is used in PWM and is started with a software trigger.
2
• EI
OS is not used.
• 16 MHz is used for the machine clock, and 62.5 ns is used for the count clock of 16-bit PPG timer.
Coding example
ICR07
PCSR1
PDUT1
PCNT1
OPCR
OPDBR0
WTIF
;-------Main program------------------------------------------------------------------------------------------------
CODE
START:
;
EQU
0000B7H
EQU
000042H
EQU
000044H
EQU
000046H
EQU
00008AH
EQU
003FE0H
EQU
OPCR:9
CSEG
:
AND
CCR,#0BFH
MOV
I:ICR01,#00H
MOVW
I:PCSR0,#0064H
MOVW
I:PDUT0,#003CH
MOVW
I:PCNT0,#01100000000000110B
MOVW
I:OPCR,#0103H
CHAPTER 15 MULTI-PULSE GENERATOR
;Interrupt control register for the waveform sequencer
;PPG period setting register
;PPG duty setting register
;PPG control status register
;Output control register
;Output data buffer register
;Interrupt request flag bit
;Assumes that stack pointer (SP) has already been
initialized
;Interrupt disable
;Interrupt level 0 (strongest)
;Sets the period of the PPG output
;Sets the duty ratio of the PPG output
;Enables PPG output in normal polarity
;Enables 16-bit PPG timer, and 62.5 ns clock
;Software triggers PPG
;Select PWM mode
;Clears interrupt flag, and starts counter
;Enable OPT0 and OPT1 output
;Sets OPDBR0 write method for data transfer
431

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents