Sample Programs For The 16-Bit Ppg Timer - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

13.8

Sample Programs for the 16-bit PPG Timer

This section contains sample programs for the 16-bit PPG timer.
■ Sample Program for the 16-bit PPG Timer
Processing
• An output in 160 kHz with 60% duty is generated with 16-bit PPG timer 0.
• The timer is used in PWM mode to repeatedly generate an interrupt.
• The timer 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.
Coding example
ICR01
PCSR0
PDUT0
PCNT0
IRQF
;-------Main program----------------------------------------------------------------------------------
CODE
START:
;
LOOP:
EQU
0000B1H
EQU
00003AH
EQU
00003CH
EQU
00003EH
EQU
PCNT0:4
CSEG
:
AND
CCR,#0BFH
MOV
I:ICR01,#00H
MOVW
I:PCSR0,#0063H
MOVW
I:PDUT0,#003BH
MOVW
I:PCNT0,#01100000000100110B
MOV
ILM,#07H
OR
CCR,#40H
MOV
A,#00H
MOV
A,#01H
BRA
LOOP
CHAPTER 13 16-BIT PPG TIMER
;Interrupt control register for the 16-bit PPG timer
;PPG period setting register
;PPG duty setting register
;PPG control status 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 and enable interrupt
;Clears interrupt flag, and starts counter
;Sets ILM in PS to level 7
;Interrupt enable
;Endless loop
;
;
277

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents