Panasonic F77G, MN101C77C user manual TM0EN

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 243
Image 243

Chapter 6 8-bit Timers

Setup Procedure

 

Description

 

 

(5) Set the period of PWM "H" output.

(5) Set the "H" period of PWM output to the timer

TM0OC (x'3F52')

= x'40'

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) Start the timer operation.

 

(6) Set the TM0EN flag of the TM0MD register to

TM0MD (x'3F54')

 

"1" to operate timer 0.

bp3

:TM0EN

= 1

 

 

 

 

 

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.

8-bit PWM Output VI - 29

Page 243
Image 243
Panasonic F77G, MN101C77C user manual TM0EN