
DocID13284 Rev 2
359/564
UM0404
XBUS pulse width modulation module
Figure 152. XPWM channel block diagram
18.1 Operating
modes
The XPWM module provides four different operating modes:
•
Mode 0 standard PWM
generation (edge aligned PWM) available on four channels
•
Mode 1 Symmetrical PWM
generation (center aligned PWM) available on all four
channels
•
Burst mode
combines channels 0 and 1
•
Single shot mode
available on channels 2 and 3
Note:
The output signals of the XPWM module are XORed with the outputs of the respective port
output latches. After reset these latches are cleared, so the PWM signals are directly driven
to the port pins. By setting the respective port output latch to ‘1’ the PWM signal may be
inverted (XORed with ‘1’) before being driven to the port pin. Besides, XPOLAR register is
added to allow another level of possible polarity control. The descriptions below refer to the
standard case after reset, which is direct drive.
18.1.1
Mode 0: standard PWM generation (edge aligned PWM)
Mode 0 is selected by clearing the respective bit PMx in register XPWMCON1 to ‘0’. In this
mode the timer XPTx of the respective XPWM channel is always counting up until it reaches
the value in the associated period shadow register. Upon the next count pulse the timer is
reset to 0000h and continues counting up with subsequent count pulses.
The XPWM output signal is switched to high level when the timer contents are equal to or
greater than the contents of the pulse width shadow register.
The signal is switched back to low level when the respective timer is reset to 0000h, that
means below the pulse width shadow register. The period of the resulting PWM signal is
determined by the value of the respective XPPx shadow register plus 1, counted in units of
the timer resolution.
XPWM_Period
Mode0
= [XPPx] + 1
XPPx Period Register
Comparator
XPTx
16-bit Up/Down Counter
Shadow Register
XPWx Pulse Width Register
Input
Run
Control
Clock 1
Clock 2
Comparator
*
*
*
Up/Down/
Clear Control
Match
Output Control
Match
Write Control
* User readable & writable register
Enable
XPOUTx
x = 3...0