Rev. 1.10
94
November 26, 2019
Rev. 1.10
95
November 26, 2019
HT68FB240
USB Low Speed Flash MCU
Pulse Width Modulator
The device contains three Pulse Width Modulation outputs, PWM0, PWM1 and PWM
2
. Useful
for such applications such as motor speed control, the PWM function provides outputs with a fixed
frequency but with a duty cycle that can be varied by setting particular values into the corresponding
PWM register.
PWM Operation
The device has three PWM registers, PWM0, PWM1 and PWM
2
, where the 8-bit value, which
represents the overall duty cycle of one modulation cycle of the output waveform, should be placed.
To increase the PWM modulation frequency, each modulation cycle is modulated into four/two
individual modulation sub-sections, known as the 6+2/7+1 mode. Note that it is only necessary to
write the required modulation value into the corresponding PWM register as the subdivision of the
waveform into its sub-modulation cycles is implemented automatically within the microcontroller
hardware. For the device, the PWM clock source is the system clock f
SYS
.
This method of dividing the original modulation cycle into a further 2/4 sub-cycles enables the
generation of higher PWM frequencies, which allow a wider range of applications to be served. As
long as the periods of the generated PWM pulses are less than the time constants of the load, the
PWM output will be suitable as such long time constant loads will average out the pulses of the
PWM output.
PWM Modulation Frequency
PWM Cycle Frequency
PWM Cycle Duty
f
SYS
/64 for (6+2) bits mode
f
SYS
/128 for (7+1) bits mode
f
SYS
/256
[PWM]/256
PWMC Register
Bit
7
6
5
4
3
2
1
0
Name
PWMM
—
—
—
—
PWM2C PWM1C PWM0C
R/W
R/W
—
—
—
—
R/W
R/W
R/W
POR
0
—
—
—
—
0
0
0
Bit 7
PWMM:
PWM mode selection
0: (6+2) mode
1: (7+1) mode
Bit 6~3
Unimplemented, read as "0"
Bit 2
PWM2C:
PWM2 control bit
0: Disable
1: Enable
Bit 1
PWM1C:
PWM
1
control bit
0: Disable
1: Enable
Bit 0
PWM0C:
PWM
0
control bit
0: Disable
1: Enable