Shop OBEX P1 Docs P2 Docs Learn Events
Two basic stamps interfacing — Parallax Forums

Two basic stamps interfacing

ShadowDragonShadowDragon Posts: 51
edited 2005-04-05 18:31 in BASIC Stamp
Hi everyone, i would like to know how to have my two basic stamps talk to each other. I am trying t o use currently the serin and serout commands. If possible, could you please post some examples of code using these? i can use it to change er somthing to my own use.

Thank yousmile.gif

Comments

  • kb2hapkb2hap Posts: 218
    edited 2005-03-30 18:53
    There is a great nuts and volts article that explains what you want to do well.

    http://www.parallax.com/dl/docs/cols/nv/vol3/col/nv81.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-30 19:06
    Funny, the SERIN and SEROUT sections of the help file (hint, hint) show how to connect two BASIC Stamps so they can talk to each other.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-04-01 18:22
    thank you,

    btw, the help section is where i found them, and i set it up as it said, but the two still didn't work.

    thanx
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-01 21:08
    You may need to check the baud parameters -- I have used the programs in the Help file without difficulty. Check your connections (sometimes tricky when using flow control), and make sure you're using the right baudmode values for the Stamp module you're using (especially if one Stamp differs from the other).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-04-02 01:56
    these are the two programs i currently have:

    Recieve:

    ' {$STAMP BS2}
    twit VAR Byte
    INPUT 8
    OUTPUT 1

    gooot:
    SERIN 8 \19200, 2400, Plabel, [noparse][[/noparse]twit]
    GOTO gooot

    Plabel:
    OUT1=0
    PAUSE 1000
    OUT1=1
    PAUSE 1000
    GOTO gooot

    Transmit:

    ' {$STAMP BS2}
    twirl VAR Bit
    OUTPUT 8

    google:
    twirl = 1
    SEROUT 8, 2400, [noparse][[/noparse]twirl]
    GOTO google

    thanks.....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-02 02:14
    Your SERIN line is out of whack -- you're specifying a flow control pin of 19200; this is not a valid pin number. It's not a valid baudmode parameter either (not for 19.2 kBaud, anyone).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-04-02 02:22
    so what is the right way of doing this?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • BeanBean Posts: 8,129
    edited 2005-04-02 02:42
    ShadowDragon said...
    so what is the right way of doing this?

    The right way is to read the manual/help file·as was suggested.
    The baud parameter is NOT the baud rate value, you have to look it up, and it's different for difference types of basic stamps (BS2, BS2sx ect).

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video Display Module" Available Now.

    www.sxvm.com

    "A problem well defined, is a problem·half solved."
    ·
  • JonbJonb Posts: 146
    edited 2005-04-02 03:45
    For baudrates i always refer to this site:

    http://www.emesystems.com/BS2rs232.htm#Baudmode
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-04-02 04:02
    cool thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-02 04:08
    You seem to be trying to mismatch baud rates -- one program seems to be wanting to be 19.2 kBaud, the other 2400 baud. What baud do you want to use? You need to settle on one, then select the correct baudmode parameter for it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-04-02 04:15
    the one that will be most stable, ie working the fastest, yet most efficiently.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-02 05:52
    You can use 19.2 kBaud with flow control.· The baudmode parameter would be 16416 (inverted -- typical when going micro to micro), but it is really bad form (my opinion) to bury constant values like that into code that may require change.· The attached template has the correct baudmode parameters for every Stamp and most popular baud rates.·

    You would define your baud like this:

    Baud······· CON······· T19K2 + Inverted

    ... then use it like this:

    · SEROUT Spin, FCpin, Baud, [noparse][[/noparse]"Hello", CR]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-04-02 16:20
    thanks, and jast as a fyi, what i am doing is trying to use my current 2 boe bots, and trying to have the two talk to eachother about their sensor inputs.

    Thanks

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • musictechmusictech Posts: 54
    edited 2005-04-04 23:59
    I have a lab you can work through that would make you more familiar with the serin/serout command. However, most of the information comes from the help file.
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-04-05 18:31
    is it a link?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
Sign In or Register to comment.