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.

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

General-purpose timers<br />

Figure 37.<br />

Example of counter operation in encoder interface mode<br />

Figure 38 gives an example of counter behavior when IC1FP1 polarity is inverted (same<br />

configuration as above except TIM_CC1P = 1).<br />

Figure 38.<br />

Example of encoder interface mode with IC1FP1 polarity inverted<br />

The timer configured in encoder interface mode provides information on a sensor's current<br />

position. To obtain dynamic information (speed, acceleration/deceleration), measure the<br />

period between two encoder events using a second timer configured in capture mode. The<br />

output of the encoder that indicates the mechanical zero can be used for this purpose.<br />

Depending on the time between two events, the counter can also be read at regular times.<br />

Do this by latching the counter value into a third input capture register. (In this case the<br />

capture signal must be periodic and can be generated by another timer).<br />

10.1.12 Timer input XOR function<br />

The TIM_TI1S bit in the TIM1_CR2 register allows the input filter of channel 1 to be<br />

connected to the output of a XOR gate that combines the three input pins TIMxC2 to<br />

TIMxC4.<br />

Doc ID 018587 Rev 2 132/215

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

Saved successfully!

Ooh no, something went wrong!