Figure 192. Control Circuit In Gated Mode; Figure 193. Control Circuit In Trigger Mode - ST STM32F412 Reference Manual

Advanced arm-based 32-bit mcus
Table of Contents

Advertisement

RM0402
Counter clock = ck_cnt = ck_psc
Slave mode: Trigger mode
The counter can start in response to an event on a selected input.
In the following example, the upcounter starts in response to a rising edge on TI2 input:
1.
Configure the channel 2 to detect rising edges on TI2. Configure the input filter duration
(in this example, we do not need any filter, so we keep IC2F='0000'). The capture
prescaler is not used for triggering, so it does not need to be configured. The CC2S bits
are configured to select the input capture source only, CC2S='01' in TIMx_CCMR1
register. Program CC2P='1' and CC2NP='0' in TIMx_CCER register to validate the
polarity (and detect low level only).
2.
Configure the timer in trigger mode by writing SMS='110' in TIMx_SMCR register.
Select TI2 as the input source by writing TS='110' in TIMx_SMCR register.
When a rising edge occurs on TI2, the counter starts counting on the internal clock and the
TIF flag is set.
The delay between the rising edge on TI2 and the actual start of the counter is due to the
resynchronization circuit on TI2 input.
Counter clock = ck_cnt = ck_psc

Figure 192. Control circuit in gated mode

TI1
cnt_en
Counter register
30
TIF

Figure 193. Control circuit in trigger mode

TI2
cnt_en
Counter register
TIF
RM0402 Rev 6
General-purpose timers (TIM9 to TIM14)
31
32 33
34
Write TIF=0
34
35 36
37
38
MS31402V1
35
36
37
38
MS31403V1
565/1163
591

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF