Connect with us

The distance between two pulses

Discussion in 'Microcontrollers, Programming and IoT' started by bravehamid, Apr 9, 2015.

Scroll to continue with content
  1. bravehamid

    bravehamid

    27
    0
    Dec 10, 2014
    hi
    i want To measure distance between two pulse with vhdl
    in mind,what can i do?
     
  2. Sci-fi guy

    Sci-fi guy

    6
    0
    Oct 12, 2014
    Create a counter process that will start with the first pulse and end with the second pulse. The process can count the number of clock cycles that occur between the events.
     
  3. bravehamid

    bravehamid

    27
    0
    Dec 10, 2014
    As a result
    I can with number of counter and frequency of my board's calculate it
    Is that correct?
     
  4. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Yes, but understand the result you get may be a little bit off.
    So, if you can, use a more accurate clock source. (internal clocks are prone to drift and error, so using an external oscillator is ideal)
    Additionally, the math you use could introduce rounding errors.

    This is a great way of doing it though.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-