use a timer to count the time of a period signal in millisecond.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Franck84
    New Member
    • Feb 2012
    • 2

    use a timer to count the time of a period signal in millisecond.

    Hi,
    My name is Franck.I am learning how to program in C. How can I measure the period of a signal in Millisecond using a timer?

    Basically, I am receiving two pulses from a system and I need to determine the time between them.

    Thanks
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    On the whole I wouldn't use a timer for that job, I would record the time of the first pulse and then record the time of the second pulse and subtract to get the difference.

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      The C Standard states that "the range and precision of times representable in clock_t and time_t [used by the time.h functions] are implementation-defined". You may need to look for a non-Standard operating system time function to get sufficient resolution to distinguish the two pulses.

      Comment

      • Franck84
        New Member
        • Feb 2012
        • 2

        #4
        Cheers for your replies.I'm trying to working out a program with all your informations.I' m not very good in C but I should be able to get something for tomorrow. I'll let you know. Thanks again.

        Comment

        Working...