www.geehy.com Page 171
Field
Name
R/W
Description
00: CC1 channel is output
01: CC1 channel is input, and IC1 is mapped on TI1
10: CC1 channel is input, and IC1 is mapped on TI2
11: CC1 channel is input, and IC1 is mapped on TRC, and only works in
internal trigger input
Note: This bit can be written only when the channel is disabled
(TMRx_CCEN register CC1EN=0).
2
OC1FEN R/W
Output Compare Channel1 Fast Enable
0: Disable
1: Enable
This bit is used to improve the response of the capture/compare output to the
trigger input event.
3
OC1PEN R/W
Output Compare Channel1 Preload Enable
0: Preloading function is disabled; write the value of TMRx_CC1 register
through the program and it will work immediately.
1: Preloading function is enabled; write the value of TMRx_CC1 register
through the program and it will work after an update event is generated.
Note: When the protection level is 3 and the channel is configured as output,
this bit cannot be modified.
When the preload register is uncertain, PWM
mode can be used only in single pulse mode (SPMEN=1); otherwise, the
following output compare result is uncertain.
6:4
OC1MOD R/W
Output Compare Channel1 Mode Configure
000: Freeze The output compare has no effect on OC1REF
001: The output value is high when matching. When the value of counter
CNT matches the value CCx of capture/compareregister, OC1REF will
be forced to be at high level
010: The output value is low when matching. When the value of the counter
matches the value of the capture/compareregister, OC1REF will be
forced to be at low level
011: Output flaps when matching. When the value of the counter matches the
value of the capture/compareregister, flap the level of OC1REF
100: The output is forced to be ow Force OC1REF to be at low level
101: The output is forced to be high. Force OC1REF to be at high level
110: PWM mode 1 (set to high when the counter value<output compare
value; otherwise, set to low)
111: PWM mode 2 (set to high when the counter value>output compare
value; otherwise, set to low)
Note: When the protection level is 3 and the channel is configured as output,
this bit cannot be modified.
In PWM modes 1 and 2, the OC1REF level
changes when the compare result changes or when the output compare
mode changes from freeze mode to PWM mode.
15:7
Reserved
Input capture mode:
Field
Name
R/W
Description
1:0
CC1SEL R/W
Capture/Compare Channel 1 Select
00: CC1 channel is output
01: CC1 channel is input, and IC1 is mapped on TI1
10: CC1 channel is input, and IC1 is mapped on TI2
11: CC1 channel is input, and IC1 is mapped on TRC, and only works in
internal trigger input
Note: This bit can be written only when the channel is disabled (TMRx_CCEN
bit CC1EN=0).
3:2
IC1PSC R/W
Input Capture Channel 1 Perscaler Configure
00
:
PSC=1
01
:
PSC=2
10
:
PSC=4
11
:
PSC=8
PSC is prescaled factor, which triggers capture once every PSC events.
7:4
IC1F
R/W
Input Capture Channel 1 Filter Configure
0000: Filter disabled, sampling by f
DTS