Program Example Of Pwm Timer Functions - Fujitsu F2MC-8L F202RA Hardware Manual

F2mc-8l 8-bit microcontroller
Hide thumbs Also See for F2MC-8L F202RA:
Table of Contents

Advertisement

Program Example of PWM Timer Functions

● Processing specifications
A PWM wave with a duty ratio of 50% is generated. The duty ratio is then changed to 25%.
No interrupt occurs.
When the count clock is 16 t
MHz × 256 = 1.3107 ms, which occurs when the top speed of the gear (one instruction cycle = 4/F
obtained at an oscillation frequency of 12.5 MHz.
The COMR register value with a duty ratio of 50% is shown below.
COMR register value = 50/100 × 256 = 128 (080
● Coding example
CNTR EQU
COMR EQU
TPE
;------------------------Main program---------------------------------------------------------------------------------
;---------------------------------------------------------------------------------------------------------------------
of an internal count clock, the cycle of the PWM wave is 16 × 4/12.5
INST
0022H
0023H
EQU
CNTR:3
CSEG
:
CLRB
TPE
MOV
COMR,#80H
MOV
CNTR,#10011010B ; PWM timer operation, selection of 16 t
:
:
MOV
COMR,#40H
:
ENDS
END
CHAPTER 7 8-BIT PWM TIMER
)
H
; Address of the PWM control register
; Address of the PWM compare register
; Defining the bit to enable the counter operation
; [CODE SEGMENT]
; Stopping the counter operation
; Specification of the H-level width of a pulse, 50% duty
ratio
; Starting the counter operation, clearing the interrupt
request flag
; Enabling the output of the PWM pin, disabling the output
of interrupt requests
; Changing the duty ratio to 25% (Takes effect at the next
cycle of the PWM wave.)
) is
CH
INST
159

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-8l mb89202Mb89202/f202ra series

Table of Contents