English
Language : 

HD6433802H Datasheet, PDF (299/435 Pages) Hitachi Semiconductor – Single-Chip Microcomputer
11.3 Operation
11.3.1 Operation
When using the 10-bit PWM, set the registers in the following sequence.
1. Set PWM1 or PWM2 in PMR9 to 1 for the PWM channel to be used, so that pin P90/PWM1 or
P91/PWM2 is designated as the PWM output pin.
2. Set bits PWCRm1 and PWCRm0 in the PWM control register (PWCRm) to select a
conversion period of 4,096/ø (PWCRm1 = 1, PWCRm0 = 1), 2,048/ø (PWCRm1 = 1,
PWCRm0 = 0), 1,024/ø (PWCRm1 = 0, PWCRm0 = 1), or 512/ø (PWCRm1 = 0, PWCRm0 =
0).
3. Set the output waveform data in PWDRUm and PWDRLm. Be sure to write in the correct
sequence, first PWDRLm then PWDRUm for the same channel. When data is written to
PWDRUm, the data will be latched in the PWM waveform generator, updating the PWM
waveform generation in synchronization with internal signals.
One conversion period consists of 4 pulses, as shown in figure 11.2. The total of the high-level
pulse widths during this period (TH) corresponds to the data in PWDRUm and PWDRLm.
This relation can be represented as follows.
TH = (data value in PWDRUm and PWDRLm + 4) × tø/2
where tø is the PWM input clock period: 1/ø (PWCRm = H'0), 2/ø (PWCRm = H'1), 4/ø (PWCRm
= H'2), or 8/ø (PWCRm = H'3).
Example: Settings in order to obtain a conversion period of 1,024 µs:
When PWCRm1 = 0 and PWCRm0 = 0, the conversion period is 512/ø, so ø must be
0.5 MHz. In this case, tfn = 256 µs, with 1/2ø (resolution) = 1.0 µs.
When PWCRm1 = 0 and PWCRm0 = 1, the conversion period is 1,024/ø, so ø must be
1 MHz. In this case, tfn = 256 µs, with 1/ø (resolution) = 1.0 µs.
When PWCRm1 = 1 and PWCRm0 = 0, the conversion period is 2,048/ø , so ø must be
2 MHz. In this case, tfn = 256 µs, with 2/ø (resolution) = 1.0 µs.
When PWCRm1 = 1 and PWCRm0 = 1, the conversion period is 4,096/ø, so ø must be
4 MHz.
In this case, tfn = 256 µs, with 4/ø (resolution) = 1.0 µs
Accordingly, for a conversion period of 1,024 µs, the system clock frequency (ø) must
be 0.5 MHz, 1 MHz, 2 Mhz, or 4MHz.
281