Shop OBEX P1 Docs P2 Docs Learn Events
Best way to communicate with multiple BS2 on the same serial line — Parallax Forums

Best way to communicate with multiple BS2 on the same serial line

Curtis BrooksCurtis Brooks Posts: 38
edited 2005-06-30 03:54 in BASIC Stamp
Hi all,

I'm trying to figure out the best way to communicate with multiple stamps on the same serial line to the PC. Each stamp will be setup as a slave configuration with the PC as the master. I'm trying to figure out the best way to only have a selected device respond on the network and the rest to ignore commands.

Some ideas I had:

1.·Assign a unique ID to each device and use that ID in the serin routine
2. Assign a major ID indicating device group and minor ID indicating specific device and use that in the serin routine
3. Assign a unique ID and all devices will receive a command but only selected device with matching ID will be enabled. All other devices will be disabled until a command is sent to enable them for communication by send an enable command along with the device ID.

I'm pretty sure all listed ways would work but I'm not sure of the best approach to take. Any suggestions?

Thanks in advance!

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-06-30 01:14
    Hello,

    ·· The following links may help, although with a PC as the master, not sure how you're going to do that.

    http://www.parallax.com/dl/docs/cols/nv/vol2/col/nv55.pdf

    http://www.parallax.com/dl/docs/cols/nv/vol2/col/nv56.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2005-06-30 03:18
    The plan was to use a Max232 IC with all the stamps sharing a Tx, Rx and GND line. Each stamp will be responsible for different functions such as a Temperature Data Logger, Humidity Sensor and I/O controller. Each stamp will be programmed with a command set for the stated functions. The plan is to have common communications functions for each stamp. THe PC sends a request to selected stamp and the stamp responds back to the PC, the PC sends a requestion to another slave device on the bus and that stamp responds back to the PC.

    Thanks for the links, I'll check them out...

    I'm trying to figure out the best method to implement the communications protocal between the stamps and the PC so that I can run them all from a common bus but only have the requested stamp respond at any given time.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-06-30 03:45
    Since you're wanting to create a multi-drop arrangement you must use componenst that are electrically compatible with that -- connecting the MAX232 to more than one microcontroller is going to create a big problem. User RS-485 interface chips as shown in Lon's articles.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Curtis BrooksCurtis Brooks Posts: 38
    edited 2005-06-30 03:54
    Great, I figured on that much after scanning over the articles.

    Thanks guys, you have been a lot of help to me.
Sign In or Register to comment.