GD32W51x User Manual
570
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Reserved
Reserved
CH0COMCTL[2:0]
CH0COM
SEN
CH0COM
FEN
CH0MS[1:0]
CH0CAPFLT[3:0]
CH0CAPPSC[1:0]
rw
rw
rw
Output com pare m ode:
Bits
Fields
Descriptions
31:7
Reserved
Must be kept at reset value
6:4
CH0COMCTL[2:0]
Channel 0 compare output control
This bit-field controls the behavior of the output reference signal O0CPRE w hich
drives CH0_O and CH0_ON. O0CPRE is active high, w hile CH0_O and CH0_ON
active level depends on CH0P and CH0NP bits.
000: Frozen. The O0CPRE signal keeps stable, independent of the comparison
betw een the register TIMERx_CH0CV and the counter TIMERx_CNT.
001: Set the channel output. O0CPRE signal is forced high w hen the counter
matches the output compare register TIMERx_CH0CV.
010: Clear the channel output. O0CPRE signal is forced low w hen the counter
matches the output compare register TIMERx_CH0CV.
011: Toggle on match. O0CPRE toggles w hen the counter matches the output
compare register TIMERx_CH0CV.
100: Force low . O0CPRE is forced low level.
101: Force high. O0CPRE is forced high level.
110: PWM mode0. When counting up, O0CPRE is active as long as the counter is
smaller than TIMERx_CH0CV else inactive. When counting dow n, O0CPRE is
inactive as long as the counter is larger than TIMERx_CH0CV else active.
111: PWM mode1. When counting up, O0CPRE is inactive as long as the counter
is smaller than TIMERx_CH0CV else active. When counting dow n, O0CPRE is
active as long as the counter is larger than TIMERx_C H0CV else inactive.
When configured in PWM mode, the O0CPRE level changes only w hen the output
compare mode sw itches from “frozen” mode to “PWM” mode or w hen the result of
the comparison changes.
This bit cannot be modified w hen PROT [1:0] bit-filed in TIMERx_CCHP register is
11 and CH0MS bit-filed is 00(COMPARE MODE).
3
CH0COMSEN
Channel 0 compare output shadow enable
When this bit is set, the shadow register of TIMERx_CH0CV register, w hich updates
at each update event, w ill be enabled.
0: Channel 0 output compare shadow disable
1: Channel 0 output compare shadow enable
The PWM mode can be used w ithout validating the s hadow register only in single
pulse mode (SPM bit in TIMERx_CTL0 register is set).
This bit cannot be modified w hen PROT [1:0] bit-filed in TIMERx_CCHP register is