01.06.2014 Views

STM32W108C8

STM32W108C8

STM32W108C8

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

General-purpose timers<br />

<strong>STM32W108C8</strong><br />

Bit 14 TIM_ECE: External Clock Enable<br />

This bit enables external clock mode 2.<br />

0: External clock mode 2 disabled.<br />

1: External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF<br />

signal.<br />

Note: Setting the TIM_ECE bit has the same effect as selecting external clock mode 1 with<br />

TRGI connected to ETRF (TIM_SMS=111 and TIM_TS=111).<br />

It is possible to use this mode simultaneously with the following slave modes: reset<br />

mode, gated mode and trigger mode. TRGI must not be connected to ETRF in this case<br />

(the TIM_TS bits must not be 111).<br />

If external clock mode 1 and external clock mode 2 are enabled at the same time, the<br />

external clock input will be ETRF.<br />

Bits [13:12] TIM_ETPS: External Trigger Prescaler<br />

External trigger signal ETRP frequency must be at most 1/4 of CK frequency. A prescaler can<br />

be enabled to reduce ETRP frequency. It is useful with fast external clocks.<br />

00: ETRP prescaler off.<br />

01: Divide ETRP frequency by 2.<br />

10: Divide ETRP frequency by 4.<br />

11: Divide ETRP frequency by 8.<br />

Bits [11:8] TIM_ETF: External Trigger Filter<br />

This defines the frequency used to sample the ETRP signal, f Sampling , and the length of the<br />

digital filter applied to ETRP. The digital filter is made of an event counter in which N events are<br />

needed to validate a transition on the output:<br />

0000: f Sampling = PCLK, no filtering. 1111: f Sampling = PCLK/32, N=8.<br />

0001: f Sampling = PCLK, N=2. 1110: f Sampling = PCLK/32, N=6.<br />

0010: f Sampling = PCLK, N=4. 1101: f Sampling = PCLK/32, N=5.<br />

0011: f Sampling = PCLK, N=8. 1100: f Sampling = PCLK/16, N=8.<br />

0100: f Sampling = PCLK/2, N=6. 1011: f Sampling = PCLK/16, N=6.<br />

0101: f Sampling = PCLK/2, N=8. 1010: f Sampling = PCLK/16, N=5.<br />

0110: f Sampling = PCLK/4, N=6. 1001: f Sampling = PCLK/8, N=8.<br />

0111: f Sampling = PCLK/4, N=8. 1000: f Sampling = PCLK/8, N=6.<br />

Note: PCLK is 12 MHz when the <strong>STM32W108C8</strong> is using the 24 MHz crystal oscillator, and 6<br />

MHz if using the 12 MHz RC oscillator.<br />

Bit 7 TIM_MSM: Master/Slave Mode<br />

0: No action.<br />

1: The effect of an event on the trigger input (TRGI) is delayed to allow exact synchronization<br />

between the current timer and the slave (through TRGO). It is useful for synchronizing timers<br />

on a single external event.<br />

Bits [6:4] TIM_TS: Trigger Selection<br />

This bit field selects the trigger input used to synchronize the counter.<br />

000 : Internal Trigger 0 (ITR0).<br />

100 : TI1 Edge Detector (TI1F_ED).<br />

101 : Filtered Timer Input 1 (TI1FP1).<br />

110 : Filtered Timer Input 2 (TI2FP2).<br />

111 : External Trigger input (ETRF).<br />

Note: These bits must be changed only when they are not used (when TIM_SMS=000) to<br />

avoid detecting spurious edges during the transition.<br />

145/215 Doc ID 018587 Rev 2

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

Saved successfully!

Ooh no, something went wrong!