Compare/Capture Control Register 2 (Tim1_Chctlr2) - WCH CH32V003 Series Reference Manual

Table of Contents

Advertisement

CH32V003 Reference Manual
[11:10]
IC2PSC
[9:8]
CC2S
[7:4]
IC1F
[3:2]
IC1PSC
[1:0]
CC1S

10.4.8 Compare/Capture control register 2 (TIM1_CHCTLR2)

Offset address: 0x1C
The channel can be used in input (capture mode) or output (compare mode), and the direction of the channel
is defined by the corresponding CCxS bit. The other bits of this register serve different purposes in input and
output modes. OCxx describes the function of the channel in output mode and ICxx describes the function of
the channel in input mode.
V1.3
digital filter length. The digital filter consists of an
event counter, which records N events and then
generates a jump in the output.
0000: no filter, sampled at fDTS.
1000: sampling frequency Fsampling = Fdts/8, N = 6.
0001: sampling frequency Fsampling=Fck_int, N=2.
1001: sampling frequency Fsampling = Fdts/8, N = 8.
0010: sampling frequency Fsampling=Fck_int, N=4.
1010: sampling frequency Fsampling = Fdts/16, N = 5.
0011: sampling frequency Fsampling=f=Fck_int, N=8.
1011: sampling frequency Fsampling = Fdts/16, N = 6.
0100: sampling frequency Fsampling = Fdts/2, N = 6.
1100: sampling frequency Fsampling = Fdts/16, N = 8.
0101: sampling frequency Fsampling = Fdts/2, N = 8.
1101: sampling frequency Fsampling = Fdts/32, N = 5.
0110: sampling frequency Fsampling = Fdts/4, N = 6.
1110: sampling frequency Fsampling = Fdts/32, N = 6.
0111: sampling frequency Fsampling = Fdts/4, N = 8.
1111: Sampling frequency Fsampling=Fdts/32, N=8.
Compare capture channel 2 prescaler configuration
field, these 2 bits define the prescaler coefficient for
compare capture channel 2. Once CC1E = 0, the
prescaler is reset.
RW
00: without prescaler, one capture is triggered for each
edge detected on the capture input.
01: capture triggered every 2 events.
10: capture triggered every 4 events.
11: Capture is triggered every 8 events.
Compare the capture channel 2 input selection field,
these 2 bits define the direction of the channel
(input/output), and the selection of the input pin.
00: comparative capture channel 1 channel is
configured as an output.
01: comparison capture channel 1 channel is configured
as an input and IC1 is mapped on TI1.
RW
10: comparison capture channel 1 channel is configured
as an input and IC1 is mapped on TI2.
11: The compare capture channel 1 channel is
configured as an input and IC1 is mapped on TRC. This
mode works only when the internal trigger input is
selected (by the TS bit).
Note: CC1S is writable only when the channel is off
(CC1E is 0).
RW Input capture filter 1 configuration field.
Compare the capture channel 1 prescale configuration
RW
field.
RW Compare capture channel 1 input selection fields.
106
http://wch.cn
0
0
0
0
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents