TIMER1 or RCTIME?


Results 1 to 8 of 8

Threaded View

  1. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by mcbeasleyjr View Post
    amount of time it takes from sending the signal to receiving the signal. As many of you know, we need the elapsed time in order to calculate the distance from the object. I've been trying to read up on both the TIMER registers and the RCTIME command as possibilities for helping us fix this problem but as of yet I've really gotten no where. If any of you could provide us with a sample code to go by we would greatly appreciate it. Thank you all for your time.

    Hi, ...

    Let's see:

    sound speed @ 20°C ( SQR ( 1.4*287*(273+20)) = ~ 340 m/s

    say your min distance will be ~ 10 cm ... time will be 2x.1/340 ~ 600 µS

    RCTime @ 20 Mhz gives 2µS granularity ... for a 16 bits value

    so, the range will be 10 cm to 10cm* 65535/300 = 21.8 meters.

    Looks fine ...

    Alain
    Last edited by Acetronics2; - 29th December 2008 at 15:07.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Software PWM using Timer1
    By muqasim in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th December 2009, 12:49
  2. Help with TIMER1 + SLEEP
    By Yodoad in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 22nd May 2009, 16:07
  3. Time Period of Timer1
    By arnol34 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 4th May 2007, 01:31
  4. Timer1 and Interupt wierdness
    By mind in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 23rd August 2005, 02:24
  5. PULSIN and RCTIME
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th November 2004, 15:45

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