![GigaDevice Semiconductor GD32E23 Series User Manual Download Page 358](http://html.mh-extra.com/html/gigadevice-semiconductor/gd32e23-series/gd32e23-series_user-manual_2225794358.webp)
GD32E23x User Manual
358
Figure 14-63. PWM mode timechart
0
CHxVAL
CAR
PWM MODE0
PWM MODE1
Cx OUT
Cx OUT
Interrupt signal
CHxIF
CHxOF
Channel output prepare signal
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.
Channel output complementary PWM
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 2 channels, but only the first channel
have this function. The complementary signals CHx_O and CHx_ON are controlled by a
group of parameters: the CHxEN and CHxNEN bits in the TIMERx_CHCTL2 register and the
POEN, ROS, IOS, ISOx and ISOxN bits in the TIMERx_CCHP and TIMERx_CTL1 registers.
The outputs polarity is determined by CHxP and CHxNP bits in the TIMERx_CHCTL2
register.