
Originally Posted by
mcbeasleyjr
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 14: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 " !!!
*****************************************
Bookmarks