Shop OBEX P1 Docs P2 Docs Learn Events
Inter-BS2 serin/serout communication timing — Parallax Forums

Inter-BS2 serin/serout communication timing

TaishoTaisho Posts: 34
edited 2006-07-21 00:08 in BASIC Stamp
After doing some research here I have not found this answer so I'm hoping you all can help.

I am building an autonomous that will have two BS2 controllers communicating with each other. One is the basic BS2 that comes with the Boe-Bot and the second is a BS2PX24.

First: will there be any problem with these two communicating since the PX24 is faster?

Second: If the primary controller does a serout command can the second controller miss it if it does not do a serin at the right moment or is there a type of interrupt that will ensure the secondary controller does not miss anything from the primary? I hope my wording makes sense. I am new to this whole subject.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-20 20:33
    1) There are tables in the Stamp Basic Manual that give timing constants for the different Stamps to use in SERIN and SEROUT statements for standard Bauds. That will take care of most of the timing issues -- using the same Baud.

    2) Yes, the second controller may miss the command if it's busy at the time the command is sent. The SERIN and SEROUT statements have options you can use like the "flow control" pin on SERIN. This goes low while the secondary controller is executing the SERIN and expecting some input. (See page 397 of the Stamp Manual V3.1) The primary controller can also use "flow control" in its SEROUT statements. (See page 413 of the Stamp Manual). You can have timeouts on both SERIN and SEROUT to allow recovery if there's a synchronization problem (by resending if it's the primary or trying again to do a SERIN if it's the secondary).
  • TaishoTaisho Posts: 34
    edited 2006-07-20 21:01
    SWEET!!! Thank you for the pointers and answers. I appreciate the help......

    I see the version 2.1 of the Stamp manual but not 3.1. The pages match in the 2.1 so it has my info but is there actually a 3.1?

    Post Edited (Taisho) : 7/20/2006 9:11:50 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-07-20 21:10
    Taisho -

    Depending on the exact application you may also want to look into using the WAIT parameter which will be found near the end of the PBASIC Help File SERIN Section. This would permit the secondary Stamp to wait until a particular character or set of characters is/are sent.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Mike GreenMike Green Posts: 23,101
    edited 2006-07-20 21:37
    I think what you want is the PBasic 2.5 manual. Maybe I got an earlier version and they corrected the version numbers. In any event, this is the lastest on the Parallax website.
  • TaishoTaisho Posts: 34
    edited 2006-07-21 00:08
    Thanks a lot for the help. I hope to have an intelligent robot on the loose soon. With my programming logic it is probably going to have mental issues blush.gif
Sign In or Register to comment.