BS2SX Timing Problems with the Devantech SRF04.
Archiver
Posts: 46,084
Hi..
I've been working on a robotic project for about a month now..
Everything was going great until I upgraded my BS2 to the SX. I've
worked
out most of the timing issues.. The SRF04 is causing me problems
with unstable results. I've followed the program example in the
manual and
have increased my convfac to 183 and my pulsout to 13. The results
are unstable and make it tough to rely on this data for
navigation.. If someone
could offer and words of advise, I'd greatly appreciate it..
V/R
Doug
dpervine@s...
'{$STAMP BS2sx}
'SETUP SRF
convf con 183
init con 0
echo con 1
range var word
MAIN:
gosub SRF
debug DEC range,cr
pause 250
goto MAIN
SRF:
pulsout init,13
pulsin echo,1,range
pulsout init,13
pulsin echo,1,range
range=range/convf
pause 10
return
I've been working on a robotic project for about a month now..
Everything was going great until I upgraded my BS2 to the SX. I've
worked
out most of the timing issues.. The SRF04 is causing me problems
with unstable results. I've followed the program example in the
manual and
have increased my convfac to 183 and my pulsout to 13. The results
are unstable and make it tough to rely on this data for
navigation.. If someone
could offer and words of advise, I'd greatly appreciate it..
V/R
Doug
dpervine@s...
'{$STAMP BS2sx}
'SETUP SRF
convf con 183
init con 0
echo con 1
range var word
MAIN:
gosub SRF
debug DEC range,cr
pause 250
goto MAIN
SRF:
pulsout init,13
pulsin echo,1,range
pulsout init,13
pulsin echo,1,range
range=range/convf
pause 10
return
Comments
Acroname document. I did have to double the CONVF value if I remember right.
Ocassionally you will get a false measurement of zero and this will throw
things off -- I always averaged three measurements to be sure things were
kosher.
Original Message
> I've been working on a robotic project for about a month now..
> Everything was going great until I upgraded my BS2 to the SX. I've
> worked
> out most of the timing issues.. The SRF04 is causing me problems
> with unstable results. I've followed the program example in the
> manual and
> have increased my convfac to 183 and my pulsout to 13. The results
> are unstable and make it tough to rely on this data for
> navigation.. If someone
> could offer and words of advise, I'd greatly appreciate it..
This may solve your problem
http://www.robot-electronics.co.uk/htm/srf04_er1.shtml
Later
Dan
--- In basicstamps@y..., "dmpervine" <dmpervine@y...> wrote:
> Hi..
>
> I've been working on a robotic project for about a month now..
> Everything was going great until I upgraded my BS2 to the SX. I've
> worked
> out most of the timing issues.. The SRF04 is causing me problems
> with unstable results. I've followed the program example in the
> manual and
> have increased my convfac to 183 and my pulsout to 13. The results
> are unstable and make it tough to rely on this data for
> navigation.. If someone
> could offer and words of advise, I'd greatly appreciate it..
>
> V/R
> Doug
> dpervine@s...
>
> '{$STAMP BS2sx}
>
> 'SETUP SRF
> convf con 183
> init con 0
> echo con 1
> range var word
>
> MAIN:
>
> gosub SRF
> debug DEC range,cr
> pause 250
> goto MAIN
>
> SRF:
> pulsout init,13
> pulsin echo,1,range
> pulsout init,13
> pulsin echo,1,range
> range=range/convf
> pause 10
> return
The SRF04 worked perfectly when it was with the BS2. Now that
my timing is roughly 2.5 times faster (was 2uS now .8uS).. It
creates a few problems.
--- In basicstamps@y..., "drchiodo" <dchiodo@m...> wrote:
> Doug:
>
> This may solve your problem
>
> http://www.robot-electronics.co.uk/htm/srf04_er1.shtml
>
> Later
> Dan