Panasonic MN101C77C User Manual

Page 243

Advertising
background image

VI - 29

Chapter 6 8-bit Timers

8-bit PWM Output

(5)

Set the "H" period of PWM output to the timer

0 compare register (TM0OC).

The setting value is set to 256 / 4 = 64 (x'40'),

because it should be the 1/4 duty of the full

count (256).

At that time, the timer 0 binary counter

(TM0BC) is initialized to x'00'.

(6)

Set the TM0EN flag of the TM0MD register to

"1" to operate timer 0.

Setup Procedure

(5)

Set the period of PWM "H" output.

TM0OC (x'3F52')

= x'40'

(6)

Start the timer operation.

TM0MD (x'3F54')

bp3

:TM0EN

= 1

Description

TM0BC counts up from x'00'. PWM source waveform outputs "H" till TM0BC reaches the setting

value of the TM0OC register, and outputs "L" after that. Then, TM0BC continues counting up, and

PWM source waveform outputs "H" again, once overflow happens, and TM0BC restarts counting up

from x'00'. TM0IO pin outputs the PWM source waveform with 1 count clock delay.

The initial setting of PWM output is changed from "L" output to "H" output at the selection of

PWM operation by the TMnPWM flag of the TMnMD register.

Advertising
This manual is related to the following products: