
General-purpose timer (TIM2)
RM0453
884/1454
RM0453 Rev 2
Note:
The state of the external IO pins connected to the standard OCx channels depends on the
OCx channel state and the GPIO control and alternate function registers.
26.4.12 TIM2 counter [alternate] (TIM2_CNT)
Bit 31 of this register has two possible definitions depending on the value of UIFREMAP in
TIMx_CR1 register:
•
This section is for UIFREMAP = 0
•
Next section is for UIFREMAP = 1
Bit 7
CC2NP
:
Capture/Compare 2 output Polarity.
Refer to CC1NP description
Bit 6 Reserved, must be kept at reset value.
Bit 5
CC2P
:
Capture/Compare 2 output Polarity.
refer to CC1P description
Bit 4
CC2E
:
Capture/Compare 2 output enable.
Refer to CC1E description
Bit 3
CC1NP
:
Capture/Compare 1 output Polarity.
CC1 channel configured as output
: CC1NP must be kept cleared in this case.
CC1 channel configured as input
: This bit is used in conjunction with CC1P to define
TI1FP1/TI2FP1 polarity. refer to CC1P description.
Bit 2 Reserved, must be kept at reset value.
Bit 1
CC1P
:
Capture/Compare 1 output Polarity.
0: OC1 active high (output mode) / Edge sensitivity selection (input mode, see below)
1: OC1 active low (output mode) / Edge sensitivity selection (input mode, see below)
When CC1 channel is configured as input
, both CC1NP/CC1P bits select the active
polarity of TI1FP1 and TI2FP1 for trigger or capture operations.
CC1NP=0, CC1P=0: non-inverted/rising edge. The circuit is sensitive to TIxFP1 rising edge
(capture or trigger operations in reset, external clock or trigger mode),
TIxFP1 is not inverted (trigger operation in gated mode or encoder
mode).
CC1NP=0, CC1P=1: inverted/falling edge. The circuit is sensitive to TIxFP1 falling edge
(capture or trigger operations in reset, external clock or trigger mode),
TIxFP1 is inverted (trigger operation in gated mode or encoder mode).
CC1NP=1, CC1P=1: non-inverted/both edges. The circuit is sensitive to both TIxFP1 rising
and falling edges (capture or trigger operations in reset, external clock
or trigger mode), TIxFP1is not inverted (trigger operation in gated
mode). This configuration must not be used in encoder mode.
CC1NP=1, CC1P=0: This configuration is reserved, it must not be used.
Bit 0
CC1E
:
Capture/Compare 1 output enable.
0: Capture mode disabled / OC1 is not active
1: Capture mode enabled / OC1 signal is output on the corresponding output pin
Table 184. Output control bit for standard OCx channels
CCxE bit
OCx output state
0
Output disabled (not driven by the timer: Hi-Z)
1
Output enabled (tim_ocx = tim_ Polarity)