Shop OBEX P1 Docs P2 Docs Learn Events
Subject: Basic stamp 2 SX - serial communication logger? — Parallax Forums

Subject: Basic stamp 2 SX - serial communication logger?

ArchiverArchiver Posts: 46,084
edited 2003-02-17 08:14 in General Discussion
I connected the data output pin of the reader to pin 5 on BS2 SX.
When i tried to read card the output was something really different
from the real card data.
The reader output speed is 9600bps, and none parity. (the reader is
DB9 serial interface)
Please help me.

'{$STAMP BS2sx}
'{$PORT COM1}
'{$PBASIC 2.0}
OUTPUT 7
HIGH 7
command VAR WORD
carddata var word
Pause 2000
command= "Q"
SEROUT 6, 16468, [noparse][[/noparse]command]

loo:
SERIN 5, 16468, [noparse][[/noparse]carddata]
Debug DEC carddata, " "
goto loo

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-02-14 15:07
    Hi Nameless,

    16468 is the 9600N1 number for a BS2. For a B2SX it is 16624.

    HTH,

    Jonathan

    www.madlabs.info

    Original Message
    From: <dalavera2003@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Friday, February 14, 2003 5:29 AM
    Subject: [noparse][[/noparse]basicstamps] Subject: Basic stamp 2 SX - serial communication
    logger?


    >
    > I connected the data output pin of the reader to pin 5 on BS2 SX.
    > When i tried to read card the output was something really different
    > from the real card data.
    > The reader output speed is 9600bps, and none parity. (the reader is
    > DB9 serial interface)
    > Please help me.
    >
    > '{$STAMP BS2sx}
    > '{$PORT COM1}
    > '{$PBASIC 2.0}
    > OUTPUT 7
    > HIGH 7
    > command VAR WORD
    > carddata var word
    > Pause 2000
    > command= "Q"
    > SEROUT 6, 16468, [noparse][[/noparse]command]
    >
    > loo:
    > SERIN 5, 16468, [noparse][[/noparse]carddata]
    > Debug DEC carddata, " "
    > goto loo
    >
    >
    >
    > 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/
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-17 08:14
    you use baudmode 16468 and you say you have a BS2sx at 9600bps,
    8Bits, drivent, inverted - that should be baudmode 16624 instead I
    think.
    hope this helps
Sign In or Register to comment.