Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
211
/
631
Output compare mode:
Bit field
Name
Description
15
OC2CEN
Output Compare 2 clear enable
14:12
OC2MD[2:0]
Output Compare 2 mode
11
OC2PEN
Output Compare 2 preload enable
10
OC2FEN
Output Compare 2 fast enable
9:8
CC2SEL[1:0]
Capture/compare 2 selection
These bits are used to select the input/output and input mapping of the channel
00: CC2 channel is configured as output
01: CC2 channel is configured as input, IC2 is mapped on TI2
10: CC2 channel is configured as input, IC2 is mapped on TI1
11: CC2 channel is configured as input, IC2 is mapped on TRC. This mode is only active
when the internal trigger input is selected by TIMx_SMCTRL.TSEL.
Note: CC2SEL is writable only when the channel is off (TIMx_CCEN.CC2EN = 0).
7
OC1CEN
Output Compare 1 clear enable
0: OC1REF is not affected by ETRF input level
1: OC1REF is cleared immediately when the ETRF input level is detected as high
6:4
OC1MD[2:0]
Output Compare 1 mode
These bits are used to manage the output reference signal OC1REF, which determines the
values of OC1 and OC1N, and is valid at high levels, while the active levels of OC1 and
OC1N depend on the TIMx_CCEN.CC1P and TIMx_CCEN.CC1NP bits.
000: Frozen. Comparison between TIMx_CCDAT1 register and counter TIMx_CNT has no
effect on OC1REF signal.
001: Set channel 1 to the active level on match. When TIMx_CCDAT1 = TIMx_CNT,
OC1REF signal will be forced high.
010: Set channel 1 as inactive level on match. When TIMx_CCDAT1 = TIMx_CNT,
OC1REF signal will be forced low.
011: Toggle. When TIMx_CCDAT1 = TIMx_CNT, OC1REF signal will be toggled.
100: Force to inactive level. OC1REF signal is forced low.
101: Force to active level. OC1REF signal is forced high.
110: PWM mode 1 - In up-counting mode, if TIMx_CNT < TIMx_CCDAT1, OC1REF
signal of channel 1 is high, otherwise it is low. In down-counting mode, if TIMx_CNT >
TIMx_CCDAT1, OC1REF signal of channel 1 is low, otherwise it is high.
111: PWM mode 2 - In up-counting mode, if TIMx_CNT < TIMx_CCDAT1, OC1REF
signal of channel 1 is low, otherwise it is high. In down-counting mode, if TIMx_CNT >
TIMx_CCDAT1, OC1REF signal of channel 1 is high, otherwise it is low.
Note 1: In PWM mode 1 or PWM mode 2, the OC1REF level changes only when the
comparison result changes or when the output compare mode is switched from frozen mode