29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

Advanced-control timers (TIM1&TIM8)<br />

2. Configure the channel 1 as follows, to detect rising edges on TI:<br />

– IC1F=0000: no filter.<br />

– The capture prescaler is not used for triggering <strong>and</strong> does not need to be<br />

configured.<br />

– CC1S=01in TIMx_CCMR1 register to select only the input capture source<br />

– CC1P=0 in TIMx_CCER register to validate the polarity (<strong>and</strong> detect rising edge<br />

only).<br />

3. Configure the timer in trigger mode by writing SMS=110 in TIMx_SMCR register. Select<br />

TI1 as the input source by writing TS=101 in TIMx_SMCR register.<br />

A rising edge on TI1 enables the counter <strong>and</strong> sets the TIF flag. The counter then counts on<br />

ETR rising edges.<br />

The delay between the rising edge of the ETR signal <strong>and</strong> the actual reset of the counter is<br />

due to the resynchronization circuit on ETRP input.<br />

Figure 98.<br />

Control circuit in external clock mode 2 + trigger mode<br />

TI1<br />

CEN/CNT_EN<br />

ETR<br />

Counter clock = CK_CNT = CK_PSC<br />

Counter register 34<br />

35 36<br />

TIF<br />

13.3.20 Timer synchronization<br />

The TIM timers are linked together internally for timer synchronization or chaining. Refer to<br />

Section 14.3.15: Timer synchronization on page 349 for details.<br />

13.3.21 Debug mode<br />

When the microcontroller enters debug mode (Cortex-M3 core halted), the TIMx counter<br />

either continues to work normally or stops, depending on DBG_TIMx_STOP configuration<br />

bit in DBG module. For more details, refer to Section 29.16.2: Debug support for timers,<br />

watchdog, bxCAN <strong>and</strong> I 2 C.<br />

Doc ID 13902 Rev 9 293/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!