Shop OBEX P1 Docs P2 Docs Learn Events
BS1-based — Parallax Forums

BS1-based

ArchiverArchiver Posts: 46,084
edited 2000-06-22 23:10 in General Discussion
Hi all!!! With the project I'm currently working on, it is necessary for
several Stamp 2's to communicate with one-another. So, after much
brainstorming, I have decided to use a single BS1 as "voice mail" for the
other Stamps. Each BS2 will be able to send data to the BS1 with a data
prefix, telling the BS1 which BS2 the data is intended for. Then, when each
BS2 gets to a certain point in its program, it will request data from the
BS1, and retrieve it if the data is there... I plan on doing this with I/O
lines 0-3 on the BS1 connect to Tx, Rx, I/O 0, & I/O 1 on each BS2, forming a
four line bus.

The communication protocol would be as fallows:
A BS2 checks line 4 (between BS1 I/O #3, & BS2 I/O #1) is low, if so, the BS2
makes line 4 high, and then waits a set time for the BS1 to prepare to
receive. After this time, the BS2 sends out identifying data on line 3
(between BS1 I/O #2, & BS2 I/O #0) , the first part, (probably 3 bits)
identifies the BS2 that is communicating with the BS1 (one of a possible
eight BS2's), then, the second part (1 or 2 bits) of the data tells the BS1
whether the BS2 is sending or retrieving data. If retrieving, the BS2 will
immediately prepare to receive the data, and at the same time the BS1 will
retrieve the data by finding a data string with the data prefix identifying
the intended BS2 receiver, wait an amount of time if necessary, then send the
data, if there is no data the BS1 will simply send a string of 0's. If the
BS2 is sending data, then the BS1 will prepare to receive, while the BS2 will
prepare the data, with a prefix identifying the BS2 that the data is intended
for, then send the data. When the BS2 is finished with the BS1, it will take
line 4 low again, so that other BS2's can communicate with the BS1. Data
going from BS1 to BS2 will be on line 2. Data going from BS2 to BS1 will be
on line 1.

Does anyone see any problems with this? The protocol seems sound to me,
the only problem I see, would be if two BS2's took line 4 high at _exactly_
the same time, and then tried to communicate with the BS1 simultaneously. But
how likely is that?!? And one more problem... Data storage. I have four lines
left on the BS1, and will need to hook up a memory device (at least 512 bytes
storage). Except that it is not this easy. I need to store the data in some
way, so that I can retrieve the data for each BS2. Any ideas???

So, if anyone can think of any potential problems, or improvements on this
idea, let me know.


Thanks in advance,
Edward Kindler

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-06-22 23:10
    Edward:

    It would seem to me that the use of Line 3 (sending ID info from BS2
    to BS1) could happen on the Line 1, thus saving you a line.

    One method that occurs to me to prevent the simultaneous broadcasts
    (I'm not really a hardware type, so this is somewhat speculative) is
    to have each of the 8 BS2's apply a different specific voltage to the
    Line 4. Have an a/d on the BS1. If the a/d resolution is sufficient,
    you should be able to assign the BS2's voltages so that you could tell
    if only one was broadcasting, or if multiple ones were. The Line 3
    could be raised momentarily by the BS1 to tell all BS2's to shutup and
    start over when Line 3 is lowered (use a random time after which to
    restart; or specifically code a different time for each BS2).

    A variation on the above would be to have the BS1 momentarily raise
    Line 3 to restart the communications if it was unable to decipher the
    data received on Line 1. Maybe you would consider some sort of
    checksum or parity byte as part of the transmitted packet.

    Another alternative; a polling approach. If timing is not critical,
    have the BS1 poll the BS2's. BS1 sends poll message (3-bits that
    identify which BS2) on Line 3 and wait for a response on Line4--if no
    response within a timeout time, go on to the next BS2 poll. If the
    polled BS2 wants to chat, it responds by raising Line 4. If the BS1
    sees Line 4 go high, it then waits for the BS2 to transmit the info on
    Line 1--if there in no data to send from the BS2, it sends a special
    code to say so. Then the BS1 sends any messages stored for that BS2
    on Line 2--maybe a code that is either "no message" or a count of
    messages, followed by the messages. When the BS2 is finished
    receiving the messages, it drops Line 4. Then the BS1 continues its
    round-robin polling with the next BS2.

    Just thinking out loud.

    BTW, you might be interested in taking a look at
    http://www.ibutton.com/csp.html and
    http://www.ibutton.com/software/1wire/wirekit.html .

    Regards,
    Daniel

    Original Message
    From: <RiffRaff82@a...>
    To: <basicstamps@egroups.com>
    Sent: Wednesday, June 21, 2000 03:52 PM
    Subject: [noparse][[/noparse]basicstamps] BS1-based "voice mail"


    > Hi all!!! With the project I'm currently working on, it is
    necessary for
    > several Stamp 2's to communicate with one-another. So, after much
    > brainstorming, I have decided to use a single BS1 as "voice mail"
    for the
    > other Stamps. Each BS2 will be able to send data to the BS1 with a
    data
    > prefix, telling the BS1 which BS2 the data is intended for. Then,
    when each
    > BS2 gets to a certain point in its program, it will request data
    from the
    > BS1, and retrieve it if the data is there... I plan on doing this
    with I/O
    > lines 0-3 on the BS1 connect to Tx, Rx, I/O 0, & I/O 1 on each BS2,
    forming a
    > four line bus.
    >
    > The communication protocol would be as fallows:
    > A BS2 checks line 4 (between BS1 I/O #3, & BS2 I/O #1) is low, if
    so, the BS2
    > makes line 4 high, and then waits a set time for the BS1 to prepare
    to
    > receive. After this time, the BS2 sends out identifying data on line
    3
    > (between BS1 I/O #2, & BS2 I/O #0) , the first part, (probably 3
    bits)
    > identifies the BS2 that is communicating with the BS1 (one of a
    possible
    > eight BS2's), then, the second part (1 or 2 bits) of the data tells
    the BS1
    > whether the BS2 is sending or retrieving data. If retrieving, the
    BS2 will
    > immediately prepare to receive the data, and at the same time the
    BS1 will
    > retrieve the data by finding a data string with the data prefix
    identifying
    > the intended BS2 receiver, wait an amount of time if necessary, then
    send the
    > data, if there is no data the BS1 will simply send a string of 0's.
    If the
    > BS2 is sending data, then the BS1 will prepare to receive, while the
    BS2 will
    > prepare the data, with a prefix identifying the BS2 that the data is
    intended
    > for, then send the data. When the BS2 is finished with the BS1, it
    will take
    > line 4 low again, so that other BS2's can communicate with the BS1.
    Data
    > going from BS1 to BS2 will be on line 2. Data going from BS2 to BS1
    will be
    > on line 1.
    >
    > Does anyone see any problems with this? The protocol seems sound
    to me,
    > the only problem I see, would be if two BS2's took line 4 high at
    _exactly_
    > the same time, and then tried to communicate with the BS1
    simultaneously. But
    > how likely is that?!? And one more problem... Data storage. I have
    four lines
    > left on the BS1, and will need to hook up a memory device (at least
    512 bytes
    > storage). Except that it is not this easy. I need to store the data
    in some
    > way, so that I can retrieve the data for each BS2. Any ideas???
    >
    > So, if anyone can think of any potential problems, or
    improvements on this
    > idea, let me know.
    >
    >
    > Thanks in advance,
    > Edward Kindler
    >
    >
    >
    >
    >
Sign In or Register to comment.