RM0008
●
Configure the timer in reset mode by writing SMS=100 in TIMx_SMCR register. Select
TI1 as the input source by writing TS=101 in TIMx_SMCR register.
●
Start the counter by writing CEN=1 in the TIMx_CR1 register.
The counter starts counting on the internal clock, then behaves normally until TI1 rising
edge. When TI1 rises, the counter is cleared and restarts from 0. In the meantime, the
trigger flag is set (TIF bit in the TIMx_SR register) and an interrupt request, or a DMA
request can be sent if enabled (depending on the TIE and TDE bits in TIMx_DIER register).
The following figure shows this behavior when the auto-reload register TIMx_ARR=0x36.
The delay between the rising edge on TI1 and the actual reset of the counter is due to the
resynchronization circuit on TI1 input.
Figure 131. Control circuit in reset mode
Counter clock = CK_CNT = CK_PSC
TI1
UG
Counter register
30
31
32 33 34 35 36
TIF
General-purpose timer (TIMx)
00
01 02 03 00 01 02 03
301/690
Need help?
Do you have a question about the STM32F102 Series and is the answer not in the manual?
Questions and answers