Shop OBEX P1 Docs P2 Docs Learn Events
Stamp network — Parallax Forums

Stamp network

ArchiverArchiver Posts: 46,084
edited 2003-12-29 17:23 in General Discussion
Hi,

You guys are the greatest resource.

I need to build a network of stamps.

1 Master to control everything and 6 to 12 slaves. Each of the slaves would
have their own unique program.


What I need to do is have a Master stamp send out control signals to each
stamp, telling a particular stamp to activate.

The slaves need to just sit there and wait for their "name" to be called.
When an individual stamp heard its name it would then execute a program,
then tell the Master stamp it's finished.

At this point the Master Stamp would then call the name of the next stamp
required for the display.

What would be the best way to approach this?

THanks in advance!

Rus

P.S.

The PIR info the list provided was invaluable!


[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-12-29 05:08
    Have the master board 'serout' a byte with the number of the board you want
    to control, and then a byte with a number which indicates what job you need
    done. eg 'serout - [noparse][[/noparse]"2","L"]

    Have all the slave boards only respond to the command if their identifying
    number was the first byte, eg "2" for stamp 2. I use this with up to 8
    boards, at 1200bps and it works a treat. you can do it using only 1 pin on
    each stamp as long as you are careful to time all of the commands and
    responses so that you dont have 2 boards outputting data at once, and also
    remember to change pins back to inputs as soon as they finish sending data
    out.

    Sorry I cant give you code but if you put a 10K resistor in series with
    EVERY stamp pin on the network, you should be protected in the event of any
    data clashes.

    Start with one stamp sending, and only 1 responding to get your comms up and
    running first, and only do it at 1200 bps initially until it all works
    before you try to speed it up. If you dont need speed, keep it at 1200 bps.
    As long as you have the slaves set up so that they dont answer to the master
    unless their id number was sent, you should be OK. Use a branch command
    after receiving the command to select different options with differend
    command numbers.

    Try to send data as ascii as it is easier in the long run, and you can then
    use a pc terminal program to troubleshoot or talk to the boards. (or your
    stamp editor)
    You MUST have the master initiate ALL communication, so that all slaves are
    waiting for a command, and you might send 2 bytes, say, number "2" to
    indicate stamp 2 and letter "L" to turn a light on. The slave would confirm
    that it got the reply (ideally by sending a checksum byte back) and then do
    the job. Dont allow a slave to communicate unless the master has asked that
    particular slave first.
    The master should then be in a routine where it regularly asks the slave if
    it has finished all jobs etc, maybe by sending "2" to call stamp 2, and "Q"
    to ask if the job has been done, if no reply, then the master assumes that
    it is busy.
    Use the serin 'WAIT' command with a timeout, and if you still cant get 2
    stamps talking, try pulling the data line up to 5 V with a 10K resistor.
    In my system the master is in a for/next loop asking all slaves if they are
    alive, and it generates an error if any slave does not reply. Using this
    method you can have sveral slaves working at once doing different tasks.

    Do a search on this group and EME systems for networking stamps, and you
    shoul be able to find some sample code, this has been discussed a fair bit
    before.

    Cheers, hope it helps in some way,
    Chris



    Original Message
    From: "Ghoul Will Ambassador" <rushardy@m...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, December 29, 2003 11:55 AM
    Subject: [noparse][[/noparse]basicstamps] Stamp network


    > Hi,
    >
    > You guys are the greatest resource.
    >
    > I need to build a network of stamps.
    >
    > 1 Master to control everything and 6 to 12 slaves. Each of the slaves
    would
    > have their own unique program.
    >
    >
    > What I need to do is have a Master stamp send out control signals to each
    > stamp, telling a particular stamp to activate.
    >
    > The slaves need to just sit there and wait for their "name" to be called.
    > When an individual stamp heard its name it would then execute a program,
    > then tell the Master stamp it's finished.
    >
    > At this point the Master Stamp would then call the name of the next stamp
    > required for the display.
    >
    > What would be the best way to approach this?
    >
    > THanks in advance!
    >
    > Rus
    >
    > P.S.
    >
    > The PIR info the list provided was invaluable!
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > 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.
    >
    >
    > Yahoo! Groups Links
    >
    > To visit your group on the web, go to:
    > http://groups.yahoo.com/group/basicstamps/
    >
    > To unsubscribe from this group, send an email to:
    > basicstamps-unsubscribe@yahoogroups.com
    >
    > Your use of Yahoo! Groups is subject to:
    > http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-29 12:52
    By using an open baud mode you can connect multiple Stamps to the same
    line (the manual and help file show how to do this). Then you can use
    the WAIT modifier just as you describe below. You can even give them a
    literal name, like this:

    SERIN Spin, Baud, [noparse][[/noparse]WAIT("Manny"), cmd]

    In the line above, the slave called Manny would wait for its name to be
    transmitted, then would take the next byte as its command. Of course,
    you may want to extend this by adding a data byte or two after the
    command. If you do, just make sure you transmit whatever your slaves
    are expecting.

    I wrote an article for Nuts & Volts that shows how to use a BS1 as a
    slave in this manner; you may find it helpful. It's on newsstands now,
    or if you want a bound copy you will find it as the last project in "The
    Nuts & Volts of BASIC Stamps - Volume 4."

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Ghoul Will Ambassador [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=gvyXftZZa1BvT69Yij7mIoYy1CgN7zhwHEHkYkjPk0lOmtz1rXSmwrnMdGOS_gIT92Me8UxOi43mmfDNRJyJfQ]rushardy@m...[/url
    Sent: Sunday, December 28, 2003 9:55 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Stamp network


    Hi,

    You guys are the greatest resource.

    I need to build a network of stamps.

    1 Master to control everything and 6 to 12 slaves. Each of the slaves
    would have their own unique program.


    What I need to do is have a Master stamp send out control signals to
    each stamp, telling a particular stamp to activate.

    The slaves need to just sit there and wait for their "name" to be
    called. When an individual stamp heard its name it would then execute a
    program, then tell the Master stamp it's finished.

    At this point the Master Stamp would then call the name of the next
    stamp required for the display.

    What would be the best way to approach this?

    THanks in advance!

    Rus

    P.S.

    The PIR info the list provided was invaluable!


    [noparse][[/noparse]Non-text portions of this message have been removed]


    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.


    Yahoo! Groups Links

    To visit your group on the web, go to:
    http://groups.yahoo.com/group/basicstamps/

    To unsubscribe from this group, send an email to:
    basicstamps-unsubscribe@yahoogroups.com

    Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-29 17:23
    The "Open" baud mode of SERIN/SEROUT were
    made for this purpose. The "Open" baud
    mode has you put a pull-up on the pin
    you are using for a communication bus,
    tied to the 'idle' state (look in the
    manual for SEROUT, 'open' mode, for what
    is the idle state).

    Then, when you use the SEROUT command,
    the signal is driven to the active state,
    but let float to the idle state. This means
    you can have multiple drivers and receivers
    on the comm bus line, without damaging any
    drivers. You still have to control things
    so only one driver 'talks' at a time -- but
    if two drivers DO talk at the same time, they'll
    just garble each other's data, not damage each
    other's hardware.

    The 'open' baud modes are good for multiple
    chips on the same card -- since it is using
    0 to 5 volt TTL signals. I suppose you could
    use this for multiple, very close cards
    (limit of a few feet). If you want to
    go across multiple cards, (or some distance)
    the RS-485 standard driver chips provide
    similar functionality (allow multiple
    drivers and receivers on a communication bus).
    This will work up to 4000 feet distance.



    --- In basicstamps@yahoogroups.com, "Ghoul Will Ambassador"
    <rushardy@m...> wrote:
    > Hi,
    >
    > You guys are the greatest resource.
    >
    > I need to build a network of stamps.
    >
    > 1 Master to control everything and 6 to 12 slaves. Each of the
    slaves would
    > have their own unique program.
    >
    >
    > What I need to do is have a Master stamp send out control signals
    to each
    > stamp, telling a particular stamp to activate.
    >
    > The slaves need to just sit there and wait for their "name" to be
    called.
    > When an individual stamp heard its name it would then execute a
    program,
    > then tell the Master stamp it's finished.
    >
    > At this point the Master Stamp would then call the name of the next
    stamp
    > required for the display.
    >
    > What would be the best way to approach this?
    >
    > THanks in advance!
    >
    > Rus
    >
    > P.S.
    >
    > The PIR info the list provided was invaluable!
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
Sign In or Register to comment.