cancel
Showing results for 
Search instead for 
Did you mean: 

Timer Config.

siddj
Associate II
Posted on May 17, 2009 at 16:03

Timer Config.

2 REPLIES 2
siddj
Associate II
Posted on May 17, 2011 at 13:07

Hey everyone,

I am using the STM32F103 VE chip in my project. I need to be able to record the timing between to events to measure the speed of a device. When I get an external interrupt on one of my GPIO's I know that a wheel has moved x inches. So, every time I get this interrupt I would want to start a counter and then stop , record the difference and start the timer again.

More specifically one of my GPIO pins will be high and when i get an interrupt it will be pulled low, signaling the fact that the wheel has moved x inches. Then I clear the interrupt and the same thing continues. I have TIM8 on that pin. I was wondering what configuration would be most suitable to get the time difference between the two events.

Thanks for your help!

-Regards.

amin2
Associate II
Posted on May 17, 2011 at 13:07

hi ,

Take a look on the STM8S Firmware TIM1 example ''TIM1_Input_Capture'',

it calculate the frequency of an external signal.

STM8S and STM32 Timers are compatible and the Firmwares are 99% similar.

link is :

http://www.st.com/products/support/micro/files/stm8sfwlib.zip

Amin

[ This message was edited by: amin.agina on 17-05-2009 19:34 ]