Shop OBEX P1 Docs P2 Docs Learn Events
serin/out and interference — Parallax Forums

serin/out and interference

ArchiverArchiver Posts: 46,084
edited 2002-01-26 18:58 in General Discussion
Hi again. I have a BS2 and a BS2SX and I am trying to get them to
communicate with a one wire interface. I know of the different baud
rate timings for the BS2SX, and I have pin 1 from each stamp hooked
up with a wire. I am trying to send HELLO! from the BS2, recieve it
with the BS2SX, and debug the result on the screen. When I run the
program, I get wierd symbols on the screen. I've included my source
code for each. Am I missing something? Thanks


'{$STAMP BS2sx}
A var word

start:
serin 1,16624,[noparse][[/noparse]A]
debug A
goto start


'{$STAMP BS2}

BP:
serout 1,16468,15,[noparse][[/noparse]"HELLO!"]
pause 75
goto start

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-01-26 02:53
    In a message dated 1/25/02 7:59:15 PM Central Standard Time,
    sjohns10@h... writes:


    > Hi again. I have a BS2 and a BS2SX and I am trying to get them to
    > communicate with a one wire interface. I know of the different baud
    > rate timings for the BS2SX, and I have pin 1 from each stamp hooked
    > up with a wire. I am trying to send HELLO! from the BS2, recieve it
    > with the BS2SX, and debug the result on the screen. When I run the
    > program, I get wierd symbols on the screen. I've included my source
    >

    At the risk of sounding silly ... be sure you have ground connection between
    your two Stamps. Now ask me how I know that this causes what you've
    experienced....

    -- Jon Williams
    -- Parallax


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-26 03:29
    Grounding them together works, but I want to be able to communicate
    wirelessly (sorry, I should have mentioned that before). I have two
    Linx Technoligies HP series transmitters/recievers, and I printed
    the datasheets for them. I hooked them up according to the diagrams
    on the sheets, but I've never dealt with wireless applications for
    stamps before, so I have no idea what I'm doing wrong. I'm 15 years
    old, and know only basic electronics (taught myself), so there is
    probably a simple answer to my problem that I am overlooking. If any
    of you can see what I am doing wrong it would be a great help.
    Thanks again.

    Seth Johnson
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-26 05:27
    >I get wierd symbols on the screen. I've included my source
    > code for each. Am I missing something? Thanks

    Assuming you have your baudrate etc set up correctly, then the problem is
    caused by using the serin on single characters when you are receiving a
    stream.
    There are two alternatives, either slow the output down by increasing the
    PACE value, or use a formatter on serin to receive the whole char string in
    one go. See the manual for the Serin syntax and specifically the "password"
    examples for more info.

    You really need something like this on input:

    Debug "StartInput"
    SERIN InPin, BaudRate,HandleParity, TimeOut,HandleNoSerial, [noparse][[/noparse]WAIT("HELLO!"]
    Debug "GOTIT",CR

    Regards,

    Tony Wells
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-26 05:34
    hi seth (i presume)
    check out jon's advice but it seems to me that your attempting to cram the 6
    byte string
    "hello!" into a 2 byte word "A".
    idont have a fix at the moment but i reckon
    someone will be onto it.
    regards ian
    Original Message
    From: sethjaredjeromiejohnson <sjohns10@h...>
    To: basicstamps@yahoogroups.com <basicstamps@yahoogroups.com>
    Date: Saturday, January 26, 2002 2:57 PM
    Subject: [noparse][[/noparse]basicstamps] serin/out and interference


    >Hi again. I have a BS2 and a BS2SX and I am trying to get them to
    >communicate with a one wire interface. I know of the different baud
    >rate timings for the BS2SX, and I have pin 1 from each stamp hooked
    >up with a wire. I am trying to send HELLO! from the BS2, recieve it
    >with the BS2SX, and debug the result on the screen. When I run the
    >program, I get wierd symbols on the screen. I've included my source
    >code for each. Am I missing something? Thanks
    >
    >
    >'{$STAMP BS2sx}
    >A var word
    >
    >start:
    > serin 1,16624,[noparse][[/noparse]A]
    > debug A
    >goto start
    >
    >
    >
    >'{$STAMP BS2}
    >
    >BP:
    > serout 1,16468,15,[noparse][[/noparse]"HELLO!"]
    > pause 75
    >goto start
    >
    >
    >
    >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 2002-01-26 08:38
    Hi Johnson

    Check on page 292 on Basic Stamp Programming Manual v 2.0c (last page on
    SERIN command) : "Demo Program (SERIN-OUT_SENDER.bs2 &
    SERIN-OUT_RECEIVER.bs2). It explains the use of FPin (flow control status).

    What could be happening is that your receiver is not waiting time enough to
    collect the full message from the sender. Using flow control will make SERIN
    wait till the sender frees it.

    Best regards
    Rui


    Mensagem original
    De: sethjaredjeromiejohnson [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=sP62RBXHXzYzuIUGRKc_Asq-i_w6CJa7HqpjJCQuz-wCWbmMaxvo77V9x5EuKqlSep0DDjQY3jRFZMg]sjohns10@h...[/url
    Enviada: s
  • ArchiverArchiver Posts: 46,084
    edited 2002-01-26 18:58
    Hi,

    The word variable A is indeed an error.
    Change the receiver code to

    A var byte(6)
    N var byte

    start:
    serin 1,16624,[noparse][[/noparse]str A\6] 'receive string 6 bytes long
    for N=0 to 5
    debug a(N) 'print all string characters
    next
    debug cr 'print a carriage return
    goto start


    regards peter



    Oorspronkelijk bericht
    Van: Ian Lawson [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Ou2s-h2YDrAvwSdgwaVHDKA0H0idLi3PVX-eVE_ibQaDMe7xJ21YUgc6AuYOfuqU1GhplNZTbhiV6w]irlawson@i...[/url
    Verzonden: vrijdag 25 januari 2002 21:34
    Aan: basicstamps@yahoogroups.com
    Onderwerp: Re: [noparse][[/noparse]basicstamps] serin/out and interference

    hi seth (i presume)
    check out jon's advice but it seems to me that your attempting to cram the 6
    byte string
    "hello!" into a 2 byte word "A".
    idont have a fix at the moment but i reckon
    someone will be onto it.
    regards ian
    Original Message
    From: sethjaredjeromiejohnson <sjohns10@h...>
    To: basicstamps@yahoogroups.com <basicstamps@yahoogroups.com>
    Date: Saturday, January 26, 2002 2:57 PM
    Subject: [noparse][[/noparse]basicstamps] serin/out and interference


    >Hi again. I have a BS2 and a BS2SX and I am trying to get them to
    >communicate with a one wire interface. I know of the different baud
    >rate timings for the BS2SX, and I have pin 1 from each stamp hooked
    >up with a wire. I am trying to send HELLO! from the BS2, recieve it
    >with the BS2SX, and debug the result on the screen. When I run the
    >program, I get wierd symbols on the screen. I've included my source
    >code for each. Am I missing something? Thanks
    >
    >
    >'{$STAMP BS2sx}
    >A var word
    >
    >start:
    > serin 1,16624,[noparse][[/noparse]A]
    > debug A
    >goto start
    >
    >
    >
    >'{$STAMP BS2}
    >
    >BP:
    > serout 1,16468,15,[noparse][[/noparse]"HELLO!"]
    > pause 75
    >goto start
    >
    >
    >
    >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/
    >
    >
    >


    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/
Sign In or Register to comment.