17-52
MPC561/MPC563 Reference Manual
MOTOROLA
MIOS14 Pulse Width Modulation Submodule (MPWMSM)
other end of the pulse width range, MPWMPULR2 can contain 0x0001 to create a pulse
width of one PWM clock count.
For example, with 0x00FF in the counter and 0x0002 in MPWMPULR2, the period is 255
PWM clock count and the pulse width is 2 PWM clock counts.
For a given system clock frequency, with a given counter divide ratio and clock selection
divide ratio, the output pulse width is given by the following equation:
where VMPWMB2 is the value in the register B2
In such conditions, the minimum output pulse width that can be obtained is given by:
and the maximum pulse width by:
17.10.3.5 Duty Cycles (0% and 100%)
The 0% and 100% duty cycles are special cases to give flexibility to the software to create
a full range of outputs. The “always set” and “always clear” conditions of the output
flip-flop are established by the value in register MPWMPULR2. These boundary
conditions are generated by software, just like another pulse. When the PWM output is
being used to generate an analog level, the 0% and 100% represent the full scale values.
The 0% output is created with a 0x0000 in register MPWMPULR2, which prevents the
output flip-flop from ever being set.
The 100% output is created when the content of register MPWMPULR2 is equal to or
greater than the content of register MPWMPERR. Thus, the width register match occurs on
counter reload. The state sequencer provides the timing to ensure that the first appearance
of a 100% value in register MPWMPULR2 causes a glitchless always-set condition of the
output flip-flop when TRSP = ‘0’.
NOTE
Even if the output is forced to 100%, the 16-bit up counter
continues its counting and that output changes to or from the
100% value are done synchronously to the selected period.
Pulse_Width
N
MCPSM
N
MPWMSM
V
MPWMB2
f
SYS
---------------------------------------------------------------------------------------------------------
=
Minimum_Pulse_Width
N
MCPSM
N
MPWMSM
f
SYS
-------------------------------------------------------------------
=
Maximum_Pulse_Width
N
MCPSM
N
MPWMSM
2
Bit_of_Resolution
1
–
()
f
SYS
-----------------------------------------------------------------------------------------------------------------------------------------
=