Local echo on BS2sx
Archiver
Posts: 46,084
I'm trying to get a BS2sx to perform birectional serial
communication with a PC through the built-in serial port
on a Board of Education. I can't seem to turn off local
echo on the device. That is, whenever I send a character
to the serial port, that same character is echoed back to
me. I have a code snippet which exhibits this behavior:
ichar VAR BYTE
mainloop:
' check console serial port for input
SERIN 16, 500, 50, nodata, [noparse][[/noparse]ichar]
IF ichar <> "A" THEN nodata
SEROUT 16, 500, [noparse][[/noparse]"BBB"]
nodata:
GOTO mainloop
Basically, it communicates at 4800 baud 8NT and looks for
the character "A" on the serial port. If it finds an "A",
then it transmits "BBB", or at least it's supposed to. I
find that it always transmits "ABBB". Note that if you try
the code with anything other than a BS2sx, you'll have to
tune the serial parameters. Clues would be appreciated.
Thanks,
sg
communication with a PC through the built-in serial port
on a Board of Education. I can't seem to turn off local
echo on the device. That is, whenever I send a character
to the serial port, that same character is echoed back to
me. I have a code snippet which exhibits this behavior:
ichar VAR BYTE
mainloop:
' check console serial port for input
SERIN 16, 500, 50, nodata, [noparse][[/noparse]ichar]
IF ichar <> "A" THEN nodata
SEROUT 16, 500, [noparse][[/noparse]"BBB"]
nodata:
GOTO mainloop
Basically, it communicates at 4800 baud 8NT and looks for
the character "A" on the serial port. If it finds an "A",
then it transmits "BBB", or at least it's supposed to. I
find that it always transmits "ABBB". Note that if you try
the code with anything other than a BS2sx, you'll have to
tune the serial parameters. Clues would be appreciated.
Thanks,
sg
Comments
writes:
communication with a PC through the built-in serial port
on a Board of Education. I can't seem to turn off local
echo on the device. That is, whenever I send a character
to the serial port, that same character is echoed back to
me. I have a code snippet which exhibits this behavior:
This behavior is caused by the Stamp serial port hardware -- you can't "turn
it off." ·But now that you know it exists, you simply filter it out.[/font]
> This behavior is caused by the Stamp serial port hardware -- you
can't "turn
> it off." But now that you know it exists, you simply filter it out.
Sure, I could do that, but I'd still like to know whether this
is the expected behavior. I've pored through the manual and
haven't found anything concerning this "feature". If I were to
move to a different BS2, would I need to include the same
filtration? I'm trying to make my code as portable as possible.
Thanks,
sg
writes:
is the expected behavior. I've pored through the manual and
haven't found anything concerning this "feature". If I were to
move to a different BS2, would I need to include the same
filtration? I'm trying to make my code as portable as possible.
Yes, it is expected (the echo is caused by port hardware and has nothing to
do with the interpreter itself). ·So, yes, your filtration will work with all
of the BS2 variants (e, sx and p). ·What you will have to change is the SERIN
and SEROUT parameters for the BS2sx and the BS2p since they run at different
clock speeds than the BS2 and BS2e.
-- Jon Williams
-- Dallas, TX[/font]
http://www.al-williams.com/wd5gnr/stampfaq.htm
Regards,
Al Williams
AWC
* Control 8 servos at once: http://www.al-williams.com/awce/pak8.htm
>
Original Message
> From: Sunil Gupta [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=mLiWsg7EjnsWXBq52_HKBUbaQnIjRjMMfSErO9Bu1q8YRGgbPEcWsf8zYMmEQSi_Ci_e746GvN0]sg@m...[/url
> Sent: Friday, January 19, 2001 8:24 AM
> To: basicstamps@egroups.com
> Subject: [noparse][[/noparse]basicstamps] Re: Local echo on BS2sx
>
>
> --- In basicstamps@egroups.com, jonwms@a... wrote:
> > This behavior is caused by the Stamp serial port hardware -- you
> can't "turn
> > it off." But now that you know it exists, you simply filter it out.
>
> Sure, I could do that, but I'd still like to know whether this
> is the expected behavior. I've pored through the manual and
> haven't found anything concerning this "feature". If I were to
> move to a different BS2, would I need to include the same
> filtration? I'm trying to make my code as portable as possible.
>
> Thanks,
> sg
>
>
>