Pwmi Prescaler (Pwmprei) (I = 0, 1); Pwmi Register (Pwmregi) (I = 0, 1) - Renesas M16C/64A Series User Manual

Table of Contents

Advertisement

M16C/64A Group
21.2.2

PWMi Prescaler (PWMPREi) (i = 0, 1)

PWMi Prescaler (i = 0, 1)
b7
21.2.3

PWMi Register (PWMREGi) (i = 0, 1)

PWMi Register (i = 0, 1)
b7
The PWMi register (i = 0, 1) sets the PWMi cycle (i = 0, 1) and high-level pulse width. The PWM cycle
and high-level pulse width are given by:
8
(
2
PWM cycle =
------------------------------------------- -
High level pulse width =
fj: PWM count source frequency (Unit: Hz)
m: PWMPREi register setting
n: PWMREGi register setting
The value written in the PWMPREi register is written to the PWMi prescaler prelatch. At the beginning
of the next PWM cycle, the PWMi prescalser prelatch value is transferred to the PWMi prescaler latch
and the PWMi prescaler, and then the associated PWMi waveform is output.
The value written in the PWMREGi register is written to the PWMi register prelatch. At the beginning of
the next PWM cycle, the PWMi register prelatch value is transferred to the PWMi register latch and the
PWMi register, and then the associated PWMi waveform is output.
When rewriting the PWMPREi and PWMREGi register values while the PWMENi bit in the PWMCON1
register is 0 (PWMi output disabled), after the PWMENi bit is set to 1 (PWMi output enabled), the
values prior to being rewritten are reflected in the first cycle of PWM output.
Refer 21.3.2 "Operation Example" for output waveforms and transfer timings.
When reading the PWMPREi register while the PWMENi bit is 0 (PWMi output disabled), the PWMi
prescaler prelatch value is read. Also, when reading the PWMREGi register, the PWMi register latch
value is read (See Figure 21.1 "Block Diagram of PWM"). When reading registers PWMPREi and
PWMREGi while the PWMENi bit is 1 (PWMi output enabled), an undefined value is read.
R01UH0136EJ0210 Rev.2.10
Jul 31, 2012
Symbol
b0
PWMPRE0
PWMPRE1
Function
PWM cycle
Symbol
b0
PWMREG0
PWMREG1
Function
Output high-level pulse width
)
×
(
)
1
m
+
1
(Units: s)
fj
(
) n
×
m
+
1
---------------------------
(Units: s)
fj
Address
0372h
0374h
Setting Range
00h to FFh
Address
0373h
0375h
Setting Range
00h to FFh
21. Pulse Width Modulator
Reset Value
00h
00h
RW
RW
Reset Value
00h
00h
RW
RW
Page 396 of 800

Advertisement

Table of Contents
loading

Table of Contents