Polaroid 6500
At 11/7/2000 03:23 PM, you wrote:
>I'm hoping somebody in stamp land out there can help me with a slight
>problem, using the following programme
>
>TIMEOFFLIGHT var word
>DISTANCE var word
>ECHO con 15
>INIT con 14
>SETTLETIME con 1
>CYCLEDELAY con 300
>
>loop:
>
>high INIT
> 'see the 6500 app notes for timing info
>pause SETTLETIME
>
>rctime ECHO,0,TIMEOFFLIGHT
> 'waits for ECHO to go low,
> 'which signals a return ping.
> 'thereshold is 1.4 volts.
>gosub ECHORECEIVED
>
>low INIT
>
>pause CYCLE_DELAY (this line would not work so changed for CYCLEDELAY)
>
>goto loop
>
>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
>
>ECHORECEIVED:
>
>DISTANCE = TIMEOFFLIGHT *7/200+22
> 'this conversion approximates centimetres,
> 'accounting for the offset imposed by the
> 'blanking signal generated by the 6500
>debug dec? DISTANCE
> 'print distance on screen
>return
>
>(typed out exactly as given on the
><mailto:nathans@i...>nathans@i..., except
>the bits in brackets)
>
Check here: [noparse]/noparse] [url=http://www.hobbyrobot.com/sensors/6500faq.html]http://www.hobbyrobot.com/sensors/6500faq.html[/url
and then look at App Note #4 [noparse][[/noparse] 6500-BS2.pdf ] on the web site.
That is a copy of the Nahans document.
Make SURE you see this:
"Code Listing Correction: INIT CON should be 9 not 14 and ECHO CON should
be 10 not 15."
Hope that straightens it out.
regards,
Bruce Bates
>I'm hoping somebody in stamp land out there can help me with a slight
>problem, using the following programme
>
>TIMEOFFLIGHT var word
>DISTANCE var word
>ECHO con 15
>INIT con 14
>SETTLETIME con 1
>CYCLEDELAY con 300
>
>loop:
>
>high INIT
> 'see the 6500 app notes for timing info
>pause SETTLETIME
>
>rctime ECHO,0,TIMEOFFLIGHT
> 'waits for ECHO to go low,
> 'which signals a return ping.
> 'thereshold is 1.4 volts.
>gosub ECHORECEIVED
>
>low INIT
>
>pause CYCLE_DELAY (this line would not work so changed for CYCLEDELAY)
>
>goto loop
>
>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
>
>ECHORECEIVED:
>
>DISTANCE = TIMEOFFLIGHT *7/200+22
> 'this conversion approximates centimetres,
> 'accounting for the offset imposed by the
> 'blanking signal generated by the 6500
>debug dec? DISTANCE
> 'print distance on screen
>return
>
>(typed out exactly as given on the
><mailto:nathans@i...>nathans@i..., except
>the bits in brackets)
>
Check here: [noparse]/noparse] [url=http://www.hobbyrobot.com/sensors/6500faq.html]http://www.hobbyrobot.com/sensors/6500faq.html[/url
and then look at App Note #4 [noparse][[/noparse] 6500-BS2.pdf ] on the web site.
That is a copy of the Nahans document.
Make SURE you see this:
"Code Listing Correction: INIT CON should be 9 not 14 and ECHO CON should
be 10 not 15."
Hope that straightens it out.
regards,
Bruce Bates
Comments
TIMEOFFLIGHT var word
DISTANCE var word
ECHO con 15
INIT con 14
SETTLETIME con 1
CYCLEDELAY con 300
loop:
high INIT
··· 'see the 6500 app notes for timing info
pause SETTLETIME
rctime ECHO,0,TIMEOFFLIGHT
··· 'waits for ECHO to go low,
··· 'which signals a return ping.
··· 'thereshold is 1.4 volts.
gosub ECHORECEIVED
low INIT
pause CYCLE_DELAY······ (this line would not work so changed for CYCLEDELAY)
goto loop
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ECHORECEIVED:
DISTANCE = TIMEOFFLIGHT *7/200+22
··· 'this conversion approximates centimetres,
··· 'accounting for the offset imposed by the
··· 'blanking signal generated by the 6500
debug dec? DISTANCE
··· 'print distance on screen
return
(typed out exactly as given on the nathans@ieland.stanford.edu, except the bits in brackets)
the problem i'm getting is that, the debug screen displays 'distance=22' no matter what distance I set the sensor at. I have the 4k7 pull up resistor and the 470uf capacitor in place. The line that includes *7/200+22 if I change the 22 for any other number the debug displays that instead. If anybody has experienced similar problems with the 6500 board or any other problems please let me know. And if anybody knows how to fix them then I especially want to hear from you.
Many thanks in advance.
John
Original Message
From: john & lisa
To: basicstamps@egroups.com
Sent: Tuesday, November 07, 2000 3:23 PM
Subject: Polaroid 6500
I'm hoping somebody in stamp land out there can help me with a slight problem, using the following programme
TIMEOFFLIGHT var word
DISTANCE var word
ECHO con 15
INIT con 14
SETTLETIME con 1
CYCLEDELAY con 300
loop:
high INIT
··· 'see the 6500 app notes for timing info
pause SETTLETIME
rctime ECHO,0,TIMEOFFLIGHT
··· 'waits for ECHO to go low,
··· 'which signals a return ping.
··· 'thereshold is 1.4 volts.
gosub ECHORECEIVED
low INIT
pause CYCLE_DELAY······ (this line would not work so changed for CYCLEDELAY)
goto loop
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
ECHORECEIVED:
DISTANCE = TIMEOFFLIGHT *7/200+22
··· 'this conversion approximates centimetres,
··· 'accounting for the offset imposed by the
··· 'blanking signal generated by the 6500
debug dec? DISTANCE
··· 'print distance on screen
return
(typed out exactly as given on the nathans@ieland.stanford.edu, except the bits in brackets)
the problem i'm getting is that, the debug screen displays 'distance=22'· and/or diffrent other numbers normally 3 numbers i.e 'distance=147' no matter what distance I set the sensor at. These numbers are totaly random so making programing very difficult. I have the 4k7 pull up resistor and the 470uf capacitor in place. The line that includes *7/200+22 if I change the 22 for any other number the debug displays that instead. If anybody has experienced similar problems with the 6500 board or any other problems please let me know. And if anybody knows how to fix them then I especially want to hear from you.
Many thanks in advance.
John