09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Advanced-control timers (TIM1&TIM8) <strong>RM0090</strong><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 and does not need to be<br />

configured.<br />

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

– CC1P=0 and CC1NP=’0’ in TIMx_CCER register to validate the polarity (and<br />

detect rising edge 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 and sets the TIF flag. The counter then counts on<br />

ETR rising edges.<br />

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

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

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

14.3.20 Timer synchronization<br />

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

Section 15.3.15: Timer synchronization on page 449 for details.<br />

14.3.21 Debug mode<br />

TI1<br />

CEN/CNT_EN<br />

ETR<br />

Counter clock = CK_CNT = CK_PSC<br />

When the microcontroller enters debug mode (Cortex-M4F 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 33.16.2: Debug support for timers,<br />

watchdog, bxCAN and I2C.<br />

389/1416 Doc ID 018909 Rev 3<br />

Counter register 34<br />

35 36<br />

TIF

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

Saved successfully!

Ooh no, something went wrong!