
CH32V003
Reference Manual
V1.3
105
comparison result is changed or when switching from
freeze mode to PWM mode in the output comparison
mode.
11
OC2PE
RW
Compare Capture Register 2 preload enable bit.
1: Enable the preload function of compare capture
registers, read and write operations only operate on the
preload registers, the preload value of compare capture
register 1 is loaded into the current shadow register
when the update event comes;
0: Disable the preload function of compare capture
register 2, compare capture register 2 can be written at
any time, and the newly written value takes effect
immediately.
Note: Once the LOCK level is set to 3 and CC1S=00,
this bit cannot be modified; PWM mode can be used
only in single pulse mode (OPM=1) without confirming
the pre-load register, otherwise its action is not
determined.
0
10
OC2FE
RW
Compare Capture Channel 2 fast enable bit, this bit is
used to speed up the response of the compare capture
channel output to a trigger input event.
1: The active edge of the input to the flipflop acts as if
a comparison match has occurred. Therefore, the OC is
set to the comparison level independent of the
comparison result. The delay between the valid edge of
the sample trigger and the output of the compare
capture channel 2 is reduced to 3 clock cycles.
0: Based on the value of the counter and compare
capture register 2, compare capture channel 2 operates
normally, even if the flip-flop is open. The minimum
delay to activate the compare capture channel 2 output
is 5 clock cycles when the input of the flipflop has a
valid edge.
OC2FE only works when the channel is configured to
PWM1 or PWM2 mode.
0
[9:8]
CC2S
RW
Compare capture channel 2 input selection fields.
00: comparison capture channel 2 is configured as an
output.
01: comparison capture channel 2 is configured as an
input and IC2 is mapped on TI2.
10: comparison capture channel 2 is configured as an
input and IC2 is mapped on TI1.
11: Compare Capture Channel 2 is configured as an
input and IC2 is mapped on TRC. This mode works
only when the internal trigger input is selected (by the
TS bit).
Note: Compare Capture Channel 2 is writable only
when the channel is off (when CC2E is zero).
0
7
OC1CE
RW Compare capture channel 1 clear enable bit.
0
[6:4]
OC1M
RW Compare capture channel 1 mode setting field.
0
3
OC1PE
RW Compare capture register 1 preload enable bit.
0
2
OC1FE
RW Compare capture channel 1 fast enable bit.
0
[1:0]
CC1S
RW Compare capture channel 1 input selection fields.
0
Capture mode (pin direction is input).
Bit
Name
Access
Description
Reset
value
[15:12] IC2F
RW
The input capture filter 2 configuration field, these bits
set the sampling frequency of the TI1 input and the
0