[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Oct 13 05:40:43 1993 
Subject:Re: 386 sonar 
From:Jeff Fox 
Volume-ID:931015.05 

In article <29folc$8pb@skates.gsfc.nasa.gov> nstn@quercus.gsfc.nasa.gov (Nathan Stratton) writes:
>Yes, I am using a complete 386 40 Mhz motherboard. I am running f83 and would
>like to use interups to recive the ping. How fast is the counter in a 386
>can it coung below 1 ms?? Can someone give me some rought code to do this.
>To send a ping load 768 with a 1, when the ping is recived it will set bit
>1 of 772. I would like to thank all the people helping me on this I am 17 
>and working on a robotics project. A lot of people dont want to bother to take
>the time to help. 
>
>Thanks.
>
>Nathan Stratton
>nstn@quercus.gsfc.nasa.gov
>

A  40 meg 386 is fast enought that a simple increment of a number (1+) in
a loop that tests for a bit of i/o will occur faster than one per millisecond
in high level forth.  A quick look at FPC tells me about 10 increments per
millisecond is what you might expect.  Since sound travels at about 1000 feet
per second, a pulse can only go out 500 feet and return in 1 second.  So about
1/2 foot per millisecond.  So is 1/2 inch resolution is good enough for your
needs just put 0 on the stack, and do 1+ until you see the echo.
You can always code the timing loop in assembler is your high level forth is
not fast enough to give you the resolution that you need.  But I would think
that high level will be fast enough for your needs.  
Also since a pulse can return from a typical sonar measurement in a small
fraction of a second, just try it out in high level and wait for the echo.
Dont worry about interrupts or multitasking problems at first.  You might
however need to have a limit in your loop if there is any change that you
will not see any echo.

Good luck.