Figure 191. Ti2 External Clock Connection Example; Figure 192. Control Circuit In External Clock Mode 1 - ST STM32F405 Reference Manual

Hide thumbs Also See for STM32F405:
Table of Contents

Advertisement

RM0090
TI2
For example, to configure the upcounter to count in response to a rising edge on the TI2
input, use the following procedure:
1.
Configure channel 2 to detect rising edges on the TI2 input by writing CC2S = '01' in
the TIMx_CCMR1 register.
2.
Configure the input filter duration by writing the IC2F[3:0] bits in the TIMx_CCMR1
register (if no filter is needed, keep IC2F='0000').
3.
Select the rising edge polarity by writing CC2P='0' and CC2NP='0' in the TIMx_CCER
register.
4.
Configure the timer in external clock mode 1 by writing SMS='111' in the TIMx_SMCR
register.
5.
Select TI2 as the trigger input source by writing TS='110' in the TIMx_SMCR register.
6.
Enable the counter by writing CEN='1' in the TIMx_CR1 register.
Note:
The capture prescaler is not used for triggering, so no need to configure it.
When a rising edge occurs on TI2, the counter counts once and the TIF flag is set.
The delay between the rising edge on TI2 and the actual clock of the counter is due to the
resynchronization circuit on TI2 input.
Counter clock = CK_CNT = CK_PSC

Figure 191. TI2 external clock connection example

TI2F_Rising
Edge
Filter
detector
TI2F_Falling
ICF[3:0]
TIMx_CCMR1

Figure 192. Control circuit in external clock mode 1

TI2
CNT_EN
Counter register
TIF
General-purpose timers (TIM9 to TIM14)
TIMx_SMCR
TS[2:0]
ITRx
0xx
TI1_ED
100
TI1FP1
101
0
TI2FP2
110
1
CC2P
TIMx_CCER
34
Write TIF = 0
RM0090 Rev 18
TI2F
or
or
TI1F
or
TRGI
External clock
mode 1
CK_INT
Internal clock
mode
(internal clock)
SMS[2:0]
TIMx_SMCR
35
CK_PSC
MS37337V1
36
MS31087V3
659/1749
695

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF