Setup Example - Panasonic MN101L Series User Manual

Lsi
Table of Contents

Advertisement

Chapter 9
16-bit Timer
9.6.2

Setup Example

Standard PWM Output Setup Example
Here is an example that, using Timer 7, the PWM output waveform with the 1/4 duty cycle and 122.1 Hz is output
from TM7IO output pin. HCLK (at f
The setup procedure and its description are shown below
TM7IO output
Step
Setting
1
Disable the timer counter
2
Select the timer output pin
3
4
Set the timer mode register
5
6
Set the "High" period of PWM
7
8
Enable the timer counter
The PWM output at the initial state is "Low". It changes to "High" at the time the PWM opera-
tion is selected by setting TM7MD2.TM7PWM to "1".
..
..
IX - 34
16-bit Standard PWM Output (with Continuously Variable Duty)
= 8 MHz) is selected as a clock source.
HCLK
122.1 Hz
Figure:9.6.4 Output Waveform of TM7IO Output Pin
Register
TM7MD.TM7EN = 0
TMIOEN1.TM7OEN = 1
P0DIR.P0DIR4 = 1
TM7MD2.TM7PWM = 1
TM7MD2.TM7BCR = 0
TM7MD1.TM7CK1-0 = 00
TM7MD1.TM7PS1-0 = 00
TM7PR1 = 0x3FFF
TM7MD1.TM7EN = 1
Description
Disable the timer count operation.
Select the timer output pin.
[Chapter 7 I/O Port]
Select the PWM output.
Select the TM7BC clear source.
Select HCLK as the count clock source.
Set the "High" period of PWM output.
Setup value: 65536 / 4 - 1 = 16383 (0x3FFF)
Enable the timer count operation.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn101lr05dMn101lr04dMn101lr03dMn101lr02d

Table of Contents