Skip to main content
nick6
Associate
January 15, 2010
Question

Timing of Input Pulses

  • January 15, 2010
  • 3 replies
  • 764 views
Posted on January 15, 2010 at 03:55

Timing of Input Pulses

    This topic has been closed for replies.

    3 replies

    nick6
    nick6Author
    Associate
    May 17, 2011
    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

    nick6
    nick6Author
    Associate
    May 17, 2011
    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

    chikos33
    Visitor II
    May 17, 2011
    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 :)