Time diference in microseconds


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    try with this

    Code:
    ' measure time that RA.1 stays high
    TMR1L=0
    TMR1H=0
    
         ' test if the signal is already high
         '
    Signal1HIGH:
    if signal1 then Signal1HIGH
    
         ' wait for the rising edge
         '
    while signal1 = 0
    wend
    
         ' signal is now high... let's count the "hi" time 
         '
    T1CON.0 = 1 ' start Timer1
    
    While signal1 ' wait for falling edge
    wend
    
    T1CON = 0 ' stopTimer
    
         ' store the result
         '
    signal1time.lowbyte = TMR1L
    Signal1time.highbyte = TMR1H
    Last edited by mister_e; - 14th February 2005 at 15:04.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Hello, long time no post (ADC sample rate)
    By Jhong2 in forum General
    Replies: 0
    Last Post: - 14th April 2009, 04:13
  2. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 02:55
  3. Measuring time
    By AugustoPedrone in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th July 2007, 23:46
  4. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts