R01UH0092EJ0110 Rev.1.10
Page 401 of 807
Jul 31, 2012
M16C/64C Group
21. Pulse Width Modulator
Figure 21.3
PWMi Output Example (Duty 0%, Duty 100%)
Figure 21.4
PWMi Output Example (PWM Output Disabled and PWM Output Resumed)
PWMi register prelatch
00h
n
FFh
n
n
Set the PWMREGi register by a program
PWMENi bit in the
PWMCON1 register
PWMi prescaler
prelatch
PWMi output
The above diagram assumes the PWMPORTi bit in the PWMCON1 register is set to 1 (PWMi output).
m
Low level is output in this cycle
when PWMi register latch is 00h
i: 0, 1
fj: PWM count source frequency
1
PWMPREi register remains unchanged and PWM cycle is constant.
PWMi register
latch
00h
n
n
FFh
High level is output in this cycle
when PWMi register latch is FFh
n
(2
8
-1)
×
(m+1)
fj
(m+1)
×
n
fj
PWMi prescaler latch
m
n1
(2
8
-1)
×
(m1+1)
fj
PWMENi bit in the
PWMCON1 register
PWMi prescaler
prelatch
PWMi output
e.g.1
PWMi register
prelatch
PWMi prescaler latch
PWMi register latch
The diagram assumes when the PWMPORTi bit in the PWMCON1 register is 1 (PWMi output).
Change by a program
m1
m1
m2
Rewritten value is reflected in second cycle of PWM output
m2
i: 0, 1
fj: PWM count source frequency
(m1+1)
×
n1
fj
(m1+1)
×
n1
fj
(2
8
-1)
×
(m2+1)
fj
PWMi outputs with value before the PWMi output is
disabled for first cycle after PWMi output is enabled
n1
n2
Set registers PWMPREi and PWMREGi by a program.
n2
(m2+1)
×
n2
fj
(2
8
-1)
×
(m1+1)
fj
e.g.2
(m1+1)
×
n1
fj
(2
8
-1)
×
(m1+1)
fj
PWMi output disabled
Maintain output level of when
PWMi output is disabled
Содержание M16C Series
Страница 846: ...M16C 64C Group R01UH0092EJ0110...