cancel
Showing results for 
Search instead for 
Did you mean: 

Timing of Input Pulses

nick6
Associate II
Posted on January 15, 2010 at 03:55

Timing of Input Pulses

3 REPLIES 3
nick6
Associate II
Posted on May 17, 2011 at 13:38

I am a newby on the ST32. Trying to measure the time between input pulses, triggered as falling edge on a single port. Having a bit of difficulty understanding the capture and compare setup and how exactly to do it.

Does the counter always start from 0 and then stop at the next falling (if so selected) edge or does one have to compare two count values and look at the difference to work out the time span?

Any help greatly appreciated.

Regards

Nick

chikos33
Associate II
Posted on May 17, 2011 at 13:38

Hi Nick,

Did you already checked the STM32 firmware library examples? They provide an example of Input Capture that, I think, fits exactly your needs.

The link if you don't have it:

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

The example is in the following path: STM32F10x_StdPeriph_Lib\Project\STM32F10x_StdPeriph_Examples\TIM\InputCapture

Good Luck and regards 🙂

nick6
Associate II
Posted on May 17, 2011 at 13:38

Hi

Many thanks - am looking at Example6 - hope I am on the right track here?

The other thing I thought of was to start a counter when a rising edge is detected and stop it on the next rising edge??? Is this workable?

Regards

Nick