Problem with serial comms with the PC
Archiver
Posts: 46,084
Jimmy-
There's a hardware-based loopback circuit on all BS2* Stamps that
results in all data received by SIN being echoed back on SOUT. This
is not a configurable option--your PC software must expect it and
deal with it. That's why you are seeing your first 123 from the PC
going back to the PC.
You're not seeing your second "received" because the first time you
go to doStuff your program stops after the debug statement, because
no instruction follows that statement. The hardware loopback is
still working but the program is complete. Hence you see the next
123 echoed back to the PC but your program didn't see it or respond
to it.
Regards,
Steve
There's a hardware-based loopback circuit on all BS2* Stamps that
results in all data received by SIN being echoed back on SOUT. This
is not a configurable option--your PC software must expect it and
deal with it. That's why you are seeing your first 123 from the PC
going back to the PC.
You're not seeing your second "received" because the first time you
go to doStuff your program stops after the debug statement, because
no instruction follows that statement. The hardware loopback is
still working but the program is complete. Hence you see the next
123 echoed back to the PC but your program didn't see it or respond
to it.
Regards,
Steve
Comments
I'm running a BS2-Sx on a basic stamp super carrier board.
I've got some Basic Stamp code like so:
{$STAMP BS2sx}
i var byte
serin 16, 16624, [noparse][[/noparse]dec i]
if i = 123 then goto doStuff
serin 16, 16624, [noparse][[/noparse]dec i]
if i = 123 then goto doStuff
END
doStuff:
debug "received", CR
I've got a VB program that sends the string 123! to the stamp, reads
a value from the stamp, sends 123! again and reads the final value.
I get the following strange output (in VB):
123!
received
123!
ie It echoes what I send to the stamp and doesn't print the second
received. Does anyone know how to get the second received printed?
What am I doing wrong ?
Thanks heaps,
Jimmy
add a goto statement after the debug statement.
Also, I think that because you are using pin 16, which I understand is the
same pin used for programming, that is the reason for the echo. At least
others have experienced similar problems. You might want to search the
archives for "echo" and see if that solves your problem. The solution might
be as simple as changing your serin pin to another pin.
Original Message
From: jamesryfler [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=U2zVCDYES1yz1P07bSV4MG7MovHTu_ClXBrq3wCGDuNr5mVJJ1ZSBvLyC7KtIKP1R-suk34Mh4HyJnrjJeKwoa0]jamesryfler@y...[/url
Sent: Tuesday, October 01, 2002 8:41 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Problem with serial comms with the PC
G'day,
I'm running a BS2-Sx on a basic stamp super carrier board.
I've got some Basic Stamp code like so:
{$STAMP BS2sx}
i var byte
serin 16, 16624, [noparse][[/noparse]dec i]
if i = 123 then goto doStuff
serin 16, 16624, [noparse][[/noparse]dec i]
if i = 123 then goto doStuff
END
doStuff:
debug "received", CR
I've got a VB program that sends the string 123! to the stamp, reads
a value from the stamp, sends 123! again and reads the final value.
I get the following strange output (in VB):
123!
received
123!
ie It echoes what I send to the stamp and doesn't print the second
received. Does anyone know how to get the second received printed?
What am I doing wrong ?
Thanks heaps,
Jimmy
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject and
Body of the message will be ignored.
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
This e-mail message may contain legally privileged and/or confidential
information. If you are not the intended recipient(s), or the employee
or agent responsible for delivery of this message to the intended
recipient(s), you are hereby notified that any dissemination,
distribution or copying of this e-mail message is strictly prohibited.
If you have received this message in error, please immediately notify
the sender and delete this e-mail message from your computer.
[noparse][[/noparse]Non-text portions of this message have been removed]