14-Bit Pwm Operation - Hitachi H8S/2199 Hardware Manual

Single-chip microcomputer
Table of Contents

Advertisement

20.3

14-Bit PWM Operation

When using the 14-bit PWM, set the registers in this sequence:
1. Set bit PWM40 to 1 in port mode register 4 (PMR4) so that pin P40/PWM14 is designated for
PWM output.
2. Set bit PWCR0 in the PWM control register (PWCR) to select a conversion period of either
32768/φ (PWCR0 = 1) or 16384/φ (PWCR0 = 0).
3. Set the output waveform data in PWM data registers U and L (PWDRU, PWDRL). Be sure to
write byte data first to PWDRL and then to PWDRU. When the data is written in PWDRU,
the contents of these registers are latched in the PWM waveform generator, and the PWM
waveform generation data is updated in synchronization with internal signals.
One conversion period consists of 64 pulses, as shown in figure 20.2. The total high-level width
during this period (T
expressed as follows:
= (data value in PWDRU and PWDRL + 64) × tφ/2
T
H
where to is the period of PWM clock input: 2/φ (bit PWCR0 = 0) or 4/φ (bit PWCR0 = 1).
If the data value in PWDRU and PWDRL is from H'3FC0 to H'3FFF, the PWM output stays high.
When the data value is H'0000, T
= 64 × tφ/2 = 32 ⋅ tφ
T
H
) corresponds to the data in PWDRU and PWDRL. This relation can be
H
is calculated as follows:
H
1 conversion period
t f1
t f2
t H1
t H2
T H = t H1 + t H2 + t H3 + ... + t H64
t f1 = t f2 = t f3 = ... = t f64
Figure 20.2 Waveform Output by 14-Bit PWM
t f63
t H3
t H63
t f64
t H64
Rev. 1.0, 02/00, page 385 of 1141

Advertisement

Table of Contents
loading

Table of Contents