GD32W51x User Manual
558
And if TIMERx_CHxCV is equal to zero, the output will be always inactive under PWM mode0
(CHxCOMCTL==3’b110).
Figure 17-62. PWM mode timechart
0
CHxVAL
CAR
PWM MODE0
PWM MODE1
Cx OUT
Cx OUT
Interrupt signal
CHxIF
Channel output reference signal
As is shown in
Figure 17-60. Output compare logic (with complementary output,
.When the TIMERx is used in the compare match output mode, the OxCPRE signal
(Channel x Output prepare signal) is defined by setting the CHxCOMCTL filed. The OxCPRE
signal has several types of output function. These include, keeping the original level by setting
the CHxCOMCTL field to 0x00, set to 1 by setting the CHxCOMCTL field to 0x01, set to 0 by
setting the CHxCOMCTL field to 0x02 or signal toggle by setting the CHxCOMCTL field to
0x03 when the counter value matches the content of the TIMERx_CHxCV register.
The PWM mode 0 and PWM mode 1 outputs are also another kind of OxCPRE output which
is setup by setting the CHxCOMCTL field to 0x06/0x07. In these modes, the OxCPRE signal
level is changed according to the counting direction and the relationship between the counter
value and the TIMERx_CHxCV content. With regard to a more detail description refer to the
relative bit definition.
Another special function of the OxCPRE signal is a forced output which can be achieved by
setting the CHxCOMCTL field to 0x04/0x05. Here the output can be forced to an
inactive/active level irrespective of the comparison condition between the counter and the
TIMERx_CHxCV values.
Outputs complementary
Function of complementary is for a pair of CHx_O and CHx_ON. Those two output signals
cannot be active at the same time. The TIMERx has only 1 channel have this function. The
complementary signals CHx_O and CHx_ON are controlled by a group of parameters: the