GD32F403xx User Manual
377
The timechart below show the three compare modes toggle/set/clear. CAR=0x63,
CHxVAL=0x3
Figure 16-64. Output-compare under three modes
CEN
CNT_REG
00
01
02
03
04
05
…
.
62
63
Overf low
match toggle
CNT_CLK
OxCPRE
00
01
02
03
04
05
…
.
62
63
01
02
03
04
05
…
.
00
match set
match clear
OxCPRE
OxCPRE
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 lev el 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.