Shop OBEX P1 Docs P2 Docs Learn Events
communication between stamps — Parallax Forums

communication between stamps

raulduke1011raulduke1011 Posts: 17
edited 2008-06-01 09:35 in Robotics
I am currently working on a project where I have two bs2sx on development boards powering the same robot. One is in charge of getting input from a PING, 2 IR, and PIR sensors. The second processes the input from the first and powers the motors, handles speaker and lights, etc. The idea is to have the first controller handle gathering of all sensory input and the second controller to serve as the brain in processing the sensory input and acting accordingly along with random behaviors of its own. I have the communication between the two working but I'm quite sure that's it's the least efficient way of doing so.

I currently have the two connected using three wires (3 pins on each) and send the message as 1 of 8 possible numbers using binary.
Ex:
001(low 0: low 1: high 2) = wall hit by right sensor
010 = wall dead ahead
011 = wall hit by left sensor

Can anyone offer some advice as to how I can make this more efficient. It is also a kind of cluttered how I have to bunch all of the sensors together and use a chart to decode the input when received by the brain.

Thanks.

Comments

  • DgswanerDgswaner Posts: 795
    edited 2008-05-13 18:22
    you should communicate with a serial connection,
    this will allow you to send and receive a lot more data, you can send strings or numbers and communication is bi-directional. The best part is that your current configuration will word for a serial connection and you have an I/O line to spare.
    take a look at the SEROUT and SERIN commands, it should be really easy to modify the demo code for your purpose.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A complex design is the sign of an inferior designer." - Jamie Hyneman, Myth Buster

    DGSwaner
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-05-14 06:36
    My stamp net uses ascii characters sent at very high speed.
    They're more easy to remember, include the entire alphabet
    and graphic characters, and have many combinations.
    I recommend starting with a two wire serial net, with flow
    control. This enables the highest baud rates and maximum
    reliability. Remember to hard wire the 1K resistor on the
    Tx/Rx line. One port is Tx/Rx and another is Fpin flow
    control. Fpin is pulled to ground through a 10K resistor.
    For your robot development, you can put the sender output
    reporting on the debug screen and the receiver on the LCD.
    Also the TTL signal gets the inversion code.

    humanoido
  • Larry SutherlandLarry Sutherland Posts: 77
    edited 2008-05-14 15:00
    Humanoido

    Could you please send some details and code so I can try this.

    Thank you
    L Sutherland

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔





    ·Right_Uderstanding, Attitude, Speech, Action, Livelihood, Effort, Concentration, and Awareness
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-05-14 16:34
    You can find all the materials at the Parallax web site, including
    code samples and hardware wiring diagrams to set up and try
    out. I simply used the latest version of the Basic Stamp manual
    posted at the parallax web site and also read the information in
    the help files within the Basic Stamp Editor. I'm still developing
    highly specific app code for publication and will release it when
    the project is complete. There are already numerous threads in
    the Parallax forum posting such applications with code and
    wiring details. This should get you started in the right direction.
    Below you can find the posts for the software code and wiring
    circuits. The nv81 is probably exactly what you're looking for.

    www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/CategoryID/9/List/0/SortField/0/Level/a/ProductID/9/Default.aspx

    www.parallax.com/tabid/477/Default.aspx

    www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol3/col/nv81.pdf

    humanoido
  • Larry SutherlandLarry Sutherland Posts: 77
    edited 2008-05-14 16:38
    Humanoido

    Thank you

    L Sutherland

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔





    ·Right_Uderstanding, Attitude, Speech, Action, Livelihood, Effort, Concentration, and Awareness
  • iamdenteddiskiamdenteddisk Posts: 66
    edited 2008-06-01 09:35
    the i2c "I-2-see"protocall is a 2 wire system supported by alot of ic chips ,and with software can be used on the bs2 's to communicate online support info on protocall and it is also in the parallax doc's. but is all over the net and most electronic devices to communicate chip2chip.
Sign In or Register to comment.