EasyManuals Logo

ST STM32F10 Series User Manual

ST STM32F10 Series
519 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #187 background imageLoading...
Page #187 background image
UM0306 Advanced control timer (TIM1)
187/519
12.4.19 Timers and external trigger synchronization
The TIM timers can be synchronized with an external trigger in several modes: Reset mode,
Gated mode and Trigger mode.
Slave mode: Reset mode
The counter and its prescaler can be reinitialized in response to an event on a trigger input.
Moreover, if the URS bit from the TIM1_CR1 register is low, an update event UEV is
generated. Then all the preloaded registers (TIM1_ARR, TIM1_CCRx) are updated.
In the following example, the up-counter is cleared in response to a rising edge on TI1 input:
Configure the channel 1 to detect rising edges on TI1. Configure the input filter duration
(in this example, we don’t need any filter, so we keep IC1F=0000). The capture
prescaler is not used for triggering, so you don’t need to configure it. The CC1S bits
select the input capture source only, CC1S = 01 in the TIM1_CCMR1 register. Write
CC1P=0 in TIM1_CCER register to validate the polarity (and detect rising edges only).
Configure the timer in reset mode by writing SMS=100 in TIM1_SMCR register. Select
TI1 as the input source by writing TS=101 in TIM1_SMCR register.
Start the counter by writing CEN=1 in the TIM1_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 TIM1_SR register) and an interrupt request, or a DMA
request can be sent if enabled (depending on the TIE and TDE bits in TIM1_DIER register).
The following figure shows this behavior when the auto-reload register TIM1_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 68. Control circuit in reset mode
00
COUNTER CLOCK = ck_cnt = ck_psc
COUNTER REGISTER
01 02 03 00 01 02 0332 33 34 35 36
UG
TI1
3130
TIF
www.BDTIC.com/ST

Table of Contents

Other manuals for ST STM32F10 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F10 Series and is the answer not in the manual?

ST STM32F10 Series Specifications

General IconGeneral
BrandST
ModelSTM32F10 Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals