Capture/Compare Channels; Figure 124. Control Circuit In External Clock Mode 2; Figure 125. Capture/Compare Channel (Example: Channel 1 Input Stage) - ST STM32F101 series Reference Manual

Advanced arm-based 32-bit mcus
Hide thumbs Also See for STM32F101 series:
Table of Contents

Advertisement

General-purpose timers (TIM2 to TIM5)
1.
As no filter is needed in this example, write ETF[3:0]=0000 in the TIMx_SMCR register.
2.
Set the prescaler by writing ETPS[1:0]=01 in the TIMx_SMCR register
3.
Select rising edge detection on the ETR pin by writing ETP=0 in the TIMx_SMCR
register
4.
Enable external clock mode 2 by writing ECE=1 in the TIMx_SMCR register.
5.
Enable the counter by writing CEN=1 in the TIMx_CR1 register.
The counter counts once each 2 ETR rising edges.
The delay between the rising edge on ETR and the actual clock of the counter is due to the
resynchronization circuit on the ETRP signal.
15.3.4

Capture/compare channels

Each Capture/Compare channel is built around a capture/compare register (including a
shadow register), a input stage for capture (with digital filter, multiplexing and prescaler) and
an output stage (with comparator and output control).
The following figure gives an overview of one Capture/Compare channel.
The input stage samples the corresponding TIx input to generate a filtered signal TIxF.
Then, an edge detector with polarity selection generates a signal (TIxFPx) which can be
used as trigger input by the slave mode controller or as the capture command. It is
prescaled before the capture register (ICxPS).

Figure 125. Capture/compare channel (example: channel 1 input stage)

375/1128

Figure 124. Control circuit in external clock mode 2

CK_INT
CNT_EN
Counter clock = CK_CNT = CK_PSC
Counter register
TI1
TI1F
filter
f
downcounter
DTS
ICF[3:0]
TIMx_CCMR1
DocID13902 Rev 15
ETR
ETRP
ETRF
34
TI1F_Rising
0
TI1FP1
Edge
Detector
TI1F_Falling
1
CC1P
TIMx_CCER
TI2F_rising
0
(from channel 2)
TI2F_falling
1
(from channel 2)
35
TI1F_ED
to the slave mode controller
01
TI2FP1
IC1
divider
10
/1, /2, /4, /8
TRC
11
(from slave mode
controller)
CC1S[1:0]
ICPS[1:0]
TIMx_CCMR1
RM0008
36
IC1PS
CC1E
TIMx_CCER

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F101 series and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Stm32f107 seriesStm32f102 seriesStm32f103 seriesStm32f105 seriesStm32f101 series

Table of Contents