Shop OBEX P1 Docs P2 Docs Learn Events
Communication Buffer?? — Parallax Forums

Communication Buffer??

ArchiverArchiver Posts: 46,084
edited 2002-07-29 22:24 in General Discussion
Hello All,

I'd like to glean some advise from all of the experience
represented here. I have a project involving two BS2's relaying machine
status back and forth to each other - communication is two-way. Neither
BS2 knows when the other will "say" or transmit something, the
communication is as needed, not at any given time or timing. My question
is: Should I use a programming loop with the SERIN command inside a
time-out loop and just check for something to be received often? or, Should
I have some kind of memory buffer between the transceiver and the BS2 to
hold received data until the program asks for it? What techniques have you
used and how have they worked?

Thank You,

Tim


Timothy Medema
CrystaLite, Incorporated
3307 Cedar St. (425) 745-6000 800-666-6065
Everett, WA 98201 Fax: (425) 257-0232

www.crystaliteinc.com
<mailto:timm@c...>timm@c...


The information transmitted is intended only for the person or entity to
whom it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from any
computer.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 21:54
    If you aren't absolutely limited to only 2 lines, 2 more can be used
    for handshaking. It's a lot faster checking a bit than waiting until
    data arrives, if it does.

    #1 -- I want to send on line 3
    #2 -- Check line, sees request, use 4 to say ok, send.

    This is way you can sychronize the data without it being real time.

    My 2 cents.
    -Martin Hebel
    Southern Illinois University


    --- In basicstamps@y..., Timothy Medema <timm@c...> wrote:
    >
    > Hello All,
    >
    > I'd like to glean some advise from all of the experience
    > represented here. I have a project involving two BS2's relaying
    machine
    > status back and forth to each other - communication is two-way.
    Neither
    > BS2 knows when the other will "say" or transmit something, the
    > communication is as needed, not at any given time or timing. My
    question
    > is: Should I use a programming loop with the SERIN command inside a
    > time-out loop and just check for something to be received often?
    or, Should
    > I have some kind of memory buffer between the transceiver and the
    BS2 to
    > hold received data until the program asks for it? What techniques
    have you
    > used and how have they worked?
    >
    > Thank You,
    >
    > Tim
    >
    >
    > Timothy Medema
    > CrystaLite, Incorporated
    > 3307 Cedar St. (425) 745-6000 800-666-6065
    > Everett, WA 98201 Fax: (425) 257-0232
    >
    > www.crystaliteinc.com
    > <mailto:timm@c...>timm@c...
    >
    >
    > The information transmitted is intended only for the person or
    entity to
    > whom it is addressed and may contain confidential and/or privileged
    > material. Any review, retransmission, dissemination or other use
    of, or
    > taking of any action in reliance upon, this information by persons
    or
    > entities other than the intended recipient is prohibited. If you
    received
    > this in error, please contact the sender and delete the material
    from any
    > computer.
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 22:01
    Hello Martin,

    Thanks for your reply. Obviously you're dealing with a
    communication rookie, could you point me to something (tutorial maybe) that
    I could read to educate myself, or examples?

    Your input is worth much more than 2 cents,

    Tim


    At 08:54 PM 7/26/2002 +0000, you wrote:
    >If you aren't absolutely limited to only 2 lines, 2 more can be used
    >for handshaking. It's a lot faster checking a bit than waiting until
    >data arrives, if it does.
    >
    >#1 -- I want to send on line 3
    >#2 -- Check line, sees request, use 4 to say ok, send.
    >
    >This is way you can sychronize the data without it being real time.
    >
    >My 2 cents.
    >-Martin Hebel
    >Southern Illinois University
    >
    >
    >--- In basicstamps@y..., Timothy Medema <timm@c...> wrote:
    > >
    > > Hello All,
    > >
    > > I'd like to glean some advise from all of the experience
    > > represented here. I have a project involving two BS2's relaying
    >machine
    > > status back and forth to each other - communication is two-way.
    >Neither
    > > BS2 knows when the other will "say" or transmit something, the
    > > communication is as needed, not at any given time or timing. My
    >question
    > > is: Should I use a programming loop with the SERIN command inside a
    > > time-out loop and just check for something to be received often?
    >or, Should
    > > I have some kind of memory buffer between the transceiver and the
    >BS2 to
    > > hold received data until the program asks for it? What techniques
    >have you
    > > used and how have they worked?
    > >
    > > Thank You,
    > >
    > > Tim
    > >
    > >
    > > Timothy Medema
    > > CrystaLite, Incorporated
    > > 3307 Cedar St. (425) 745-6000 800-666-6065
    > > Everett, WA 98201 Fax: (425) 257-0232
    > >
    > > www.crystaliteinc.com
    > > <mailto:timm@c...>timm@c...
    > >
    > >
    > > The information transmitted is intended only for the person or
    >entity to
    > > whom it is addressed and may contain confidential and/or privileged
    > > material. Any review, retransmission, dissemination or other use
    >of, or
    > > taking of any action in reliance upon, this information by persons
    >or
    > > entities other than the intended recipient is prohibited. If you
    >received
    > > this in error, please contact the sender and delete the material
    >from any
    > > computer.
    >
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

    Timothy Medema
    CrystaLite, Incorporated
    3307 Cedar St. (425) 745-6000 800-666-6065
    Everett, WA 98201 Fax: (425) 257-0232

    www.crystaliteinc.com
    <mailto:timm@c...>timm@c...


    The information transmitted is intended only for the person or entity to
    whom it is addressed and may contain confidential and/or privileged
    material. Any review, retransmission, dissemination or other use of, or
    taking of any action in reliance upon, this information by persons or
    entities other than the intended recipient is prohibited. If you received
    this in error, please contact the sender and delete the material from any
    computer.
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 22:06
    Hi again Martin,

    Also, is any additional hardware involved, or just the bit check
    at that particular pin?

    Thanks,

    Tim

    At 08:54 PM 7/26/2002 +0000, you wrote:
    >If you aren't absolutely limited to only 2 lines, 2 more can be used
    >for handshaking. It's a lot faster checking a bit than waiting until
    >data arrives, if it does.
    >
    >#1 -- I want to send on line 3
    >#2 -- Check line, sees request, use 4 to say ok, send.
    >
    >This is way you can sychronize the data without it being real time.
    >
    >My 2 cents.
    >-Martin Hebel
    >Southern Illinois University
    >
    >
    >--- In basicstamps@y..., Timothy Medema <timm@c...> wrote:
    > >
    > > Hello All,
    > >
    > > I'd like to glean some advise from all of the experience
    > > represented here. I have a project involving two BS2's relaying
    >machine
    > > status back and forth to each other - communication is two-way.
    >Neither
    > > BS2 knows when the other will "say" or transmit something, the
    > > communication is as needed, not at any given time or timing. My
    >question
    > > is: Should I use a programming loop with the SERIN command inside a
    > > time-out loop and just check for something to be received often?
    >or, Should
    > > I have some kind of memory buffer between the transceiver and the
    >BS2 to
    > > hold received data until the program asks for it? What techniques
    >have you
    > > used and how have they worked?
    > >
    > > Thank You,
    > >
    > > Tim
    > >
    > >
    > > Timothy Medema
    > > CrystaLite, Incorporated
    > > 3307 Cedar St. (425) 745-6000 800-666-6065
    > > Everett, WA 98201 Fax: (425) 257-0232
    > >
    > > www.crystaliteinc.com
    > > <mailto:timm@c...>timm@c...
    > >
    > >
    > > The information transmitted is intended only for the person or
    >entity to
    > > whom it is addressed and may contain confidential and/or privileged
    > > material. Any review, retransmission, dissemination or other use
    >of, or
    > > taking of any action in reliance upon, this information by persons
    >or
    > > entities other than the intended recipient is prohibited. If you
    >received
    > > this in error, please contact the sender and delete the material
    >from any
    > > computer.
    >
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 22:46
    Hi Tim,

    I agree with Martin, if you can run two extra lines and use two extra
    pins on each BS2, then hardware handshaking is by far the easiest way
    to go. The SERIN and SEROUT commands have options for this kind of
    flow control built in. Refer to the Stamp manual. Also I have a
    tutorial on this posted at:
    http://www.emesys.com/BS2rs232.htm#MasterSlave

    The only extra hardware you need is the two wires, and it is a good
    idea to put a resistor (~500 ohm) in series with the stamp pins at
    the ends of the wires, for protection.

    -- best regards

    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...



    >Hello Martin,
    >
    > Thanks for your reply. Obviously you're dealing with a
    >communication rookie, could you point me to something (tutorial maybe) that
    >I could read to educate myself, or examples?
    >
    >Your input is worth much more than 2 cents,
    >
    >Tim
    >
    >
    >At 08:54 PM 7/26/2002 +0000, you wrote:
    >>If you aren't absolutely limited to only 2 lines, 2 more can be used
    >>for handshaking. It's a lot faster checking a bit than waiting until
    >>data arrives, if it does.
    >>
    >>#1 -- I want to send on line 3
    >>#2 -- Check line, sees request, use 4 to say ok, send.
    >>
    >>This is way you can sychronize the data without it being real time.
    >>
    >>My 2 cents.
    >>-Martin Hebel
    >>Southern Illinois University
    > >
    >>
    >>--- In basicstamps@y..., Timothy Medema <timm@c...> wrote:
    >> >
    >> > Hello All,
    >> >
    >> > I'd like to glean some advise from all of the experience
    >> > represented here. I have a project involving two BS2's relaying
    >>machine
    >> > status back and forth to each other - communication is two-way.
    >>Neither
    >> > BS2 knows when the other will "say" or transmit something, the
    >> > communication is as needed, not at any given time or timing. My
    >>question
    >> > is: Should I use a programming loop with the SERIN command inside a
    >> > time-out loop and just check for something to be received often?
    >>or, Should
    >> > I have some kind of memory buffer between the transceiver and the
    >>BS2 to
    >> > hold received data until the program asks for it? What techniques
    >>have you
    >> > used and how have they worked?
    >> >
    >> > Thank You,
    >> >
    >> > Tim
    >> >
    >> >
    >> > Timothy Medema
    >> > CrystaLite, Incorporated
    >> > 3307 Cedar St. (425) 745-6000 800-666-6065
    >> > Everett, WA 98201 Fax: (425) 257-0232
    >> >
    >> > www.crystaliteinc.com
    >> > <mailto:timm@c...>timm@c...
    >> >
    >> >
    >> > The information transmitted is intended only for the person or
    >>entity to
    >> > whom it is addressed and may contain confidential and/or privileged
    >> > material. Any review, retransmission, dissemination or other use
    >>of, or
    >> > taking of any action in reliance upon, this information by persons
    >>or
    >> > entities other than the intended recipient is prohibited. If you
    >>received
    >> > this in error, please contact the sender and delete the material
    >>from any
    >> > computer.
    >>
    >>
    >>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.
    >>
    >>
    >>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >Timothy Medema
    >CrystaLite, Incorporated
    >3307 Cedar St. (425) 745-6000 800-666-6065
    >Everett, WA 98201 Fax: (425) 257-0232
    >
    >www.crystaliteinc.com
    ><mailto:timm@c...>timm@c...
    >
    >
    >The information transmitted is intended only for the person or entity to
    >whom it is addressed and may contain confidential and/or privileged
    >material. Any review, retransmission, dissemination or other use of, or
    >taking of any action in reliance upon, this information by persons or
    >entities other than the intended recipient is prohibited. If you received
    >this in error, please contact the sender and delete the material from any
    >computer.
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 22:59
    Hi Tracy,

    My application is wireless using the Parallax 27997 transceiver
    modules at each end. Can I use a handshanking technique in this situation
    also?

    Thank you very much,

    Tim

    At 02:46 PM 7/26/2002 -0700, you wrote:
    >Hi Tim,
    >
    >I agree with Martin, if you can run two extra lines and use two extra
    >pins on each BS2, then hardware handshaking is by far the easiest way
    >to go. The SERIN and SEROUT commands have options for this kind of
    >flow control built in. Refer to the Stamp manual. Also I have a
    >tutorial on this posted at:
    > http://www.emesys.com/BS2rs232.htm#MasterSlave
    >
    >The only extra hardware you need is the two wires, and it is a good
    >idea to put a resistor (~500 ohm) in series with the stamp pins at
    >the ends of the wires, for protection.
    >
    > -- best regards
    >
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
    >
    >
    >
    > >Hello Martin,
    > >
    > > Thanks for your reply. Obviously you're dealing with a
    > >communication rookie, could you point me to something (tutorial maybe) that
    > >I could read to educate myself, or examples?
    > >
    > >Your input is worth much more than 2 cents,
    > >
    > >Tim
    > >
    > >
    > >At 08:54 PM 7/26/2002 +0000, you wrote:
    > >>If you aren't absolutely limited to only 2 lines, 2 more can be used
    > >>for handshaking. It's a lot faster checking a bit than waiting until
    > >>data arrives, if it does.
    > >>
    > >>#1 -- I want to send on line 3
    > >>#2 -- Check line, sees request, use 4 to say ok, send.
    > >>
    > >>This is way you can sychronize the data without it being real time.
    > >>
    > >>My 2 cents.
    > >>-Martin Hebel
    > >>Southern Illinois University
    > > >
    > >>
    > >>--- In basicstamps@y..., Timothy Medema <timm@c...> wrote:
    > >> >
    > >> > Hello All,
    > >> >
    > >> > I'd like to glean some advise from all of the experience
    > >> > represented here. I have a project involving two BS2's relaying
    > >>machine
    > >> > status back and forth to each other - communication is two-way.
    > >>Neither
    > >> > BS2 knows when the other will "say" or transmit something, the
    > >> > communication is as needed, not at any given time or timing. My
    > >>question
    > >> > is: Should I use a programming loop with the SERIN command inside a
    > >> > time-out loop and just check for something to be received often?
    > >>or, Should
    > >> > I have some kind of memory buffer between the transceiver and the
    > >>BS2 to
    > >> > hold received data until the program asks for it? What techniques
    > >>have you
    > >> > used and how have they worked?
    > >> >
    > >> > Thank You,
    > >> >
    > >> > Tim
    > >> >
    > >> >
    > >> > Timothy Medema
    > >> > CrystaLite, Incorporated
    > >> > 3307 Cedar St. (425) 745-6000 800-666-6065
    > >> > Everett, WA 98201 Fax: (425) 257-0232
    > >> >
    > >> > www.crystaliteinc.com
    > >> > <mailto:timm@c...>timm@c...
    > >> >
    > >> >
    > >> > The information transmitted is intended only for the person or
    > >>entity to
    > >> > whom it is addressed and may contain confidential and/or privileged
    > >> > material. Any review, retransmission, dissemination or other use
    > >>of, or
    > >> > taking of any action in reliance upon, this information by persons
    > >>or
    > >> > entities other than the intended recipient is prohibited. If you
    > >>received
    > >> > this in error, please contact the sender and delete the material
    > >>from any
    > >> > computer.
    > >>
    > >>
    > >>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.
    > >>
    > >>
    > >>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    > >
    > >Timothy Medema
    > >CrystaLite, Incorporated
    > >3307 Cedar St. (425) 745-6000 800-666-6065
    > >Everett, WA 98201 Fax: (425) 257-0232
    > >
    > >www.crystaliteinc.com
    > ><mailto:timm@c...>timm@c...
    > >
    > >
    > >The information transmitted is intended only for the person or entity to
    > >whom it is addressed and may contain confidential and/or privileged
    > >material. Any review, retransmission, dissemination or other use of, or
    > >taking of any action in reliance upon, this information by persons or
    > >entities other than the intended recipient is prohibited. If you received
    > >this in error, please contact the sender and delete the material from any
    > >computer.
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 23:24
    In a message dated 7/26/02 18:01:23 Eastern Daylight Time,
    timm@c... writes:


    >
    >
    > My application is wireless using the Parallax 27997 transceiver
    > modules at each end. Can I use a handshanking technique in this situation
    > also?
    >
    > Thank you very much,
    >
    >

    Tim, Martin and Tracy are a lot smarter than I am, but I use an "addressable"
    serin/serout routine with both my RF (Parallax also) and my Sony Remote
    Control programs. Theirs is probably a better overall solution but if you
    get desperate I'll share.

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 23:30
    Hi Sid,

    Don't sell yourself short, we can all learn from each other -
    everyone has something to contribute! Please share your "addressable"
    technique.

    Thank you,

    Tim

    At 06:24 PM 7/26/2002 -0400, you wrote:
    >In a message dated 7/26/02 18:01:23 Eastern Daylight Time,
    >timm@c... writes:
    >
    >
    > >
    > >
    > > My application is wireless using the Parallax 27997 transceiver
    > > modules at each end. Can I use a handshanking technique in this situation
    > > also?
    > >
    > > Thank you very much,
    > >
    > >
    >
    >Tim, Martin and Tracy are a lot smarter than I am, but I use an "addressable"
    >serin/serout routine with both my RF (Parallax also) and my Sony Remote
    >Control programs. Theirs is probably a better overall solution but if you
    >get desperate I'll share.
    >
    >Sid
    >
    >
    >[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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-26 23:50
    In a message dated 7/26/02 18:32:00 Eastern Daylight Time,
    timm@c... writes:


    >
    >
    > Don't sell yourself short, we can all learn from each other -
    > everyone has something to contribute! Please share your "addressable"
    > technique.
    >

    The "addressing" is really nothing more than utilization of the 'wait"
    modifier. If you write

    serin 16, N9600, 500, nodata, [noparse][[/noparse]wait("sid"), data]

    it will sit there forever until it gets something prefaced by "sid". For
    example,

    serout 16, N9600, [noparse][[/noparse]"sid", data]

    is the only transmission the serin would respond to. So in essence it is
    "addressable". I have a program that reads and decodes the signal from a
    Sony Universal Remote, which produces 16 variables. I write

    if s(1) = 2 and s(2) = 2 and s(3) = 4 and s(4) = 2 then xmit
    goto begin

    xmit
    serout 16, N9600, [noparse][[/noparse]"sid", data]
    goto begin

    nodata
    goto begin

    Serin will wait 500ms, then jump to nodata, which sends it back to begin, and
    the process starts all over.

    Does any of this help ?


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-27 02:35
    Going wireless, huh? Hmmmmmmmmmmmmmm That adds a dimension to this
    neither mine nor Tracy's answers will suit, they relied an 4 lines.

    Without a buffer, it get's a little rough. Sid's idea to make it
    addressable helps ensure you are ready from correct incoming data,
    but the need is still there to sit and wait for it.

    Onc option I've used before is when the transmitter is ready to send,
    have it send a character repeatedly. Eventually, the reciever will
    be in a condition to catch that one character, respond, then the
    transmitter can send the entire packet knowing the reciever is
    listening.

    Attention:
    ready_bit = 1
    'keep sending 1 and waiting for reply
    SEROUT pin,baud,[noparse][[/noparse]1]
    SERIN pin,Baud,500,Attention,[noparse][[/noparse]DEC ready_bit] 'timeout repeats this
    routine
    'repeat until returning data (bit=1)
    If ready_bit = 0 Then Attention

    GotAttention:
    SEROUT pin,baud,[noparse][[/noparse]importantdata]
    .
    .
    .

    Untested code for transmitter, but doesn't look too far off....
    -Martin


    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > Hi Tim,
    >
    > I agree with Martin, if you can run two extra lines and use two
    extra
    > pins on each BS2, then hardware handshaking is by far the easiest
    way
    > to go. The SERIN and SEROUT commands have options for this kind of
    > flow control built in. Refer to the Stamp manual. Also I have a
    > tutorial on this posted at:
    > http://www.emesys.com/BS2rs232.htm#MasterSlave
    >
    > The only extra hardware you need is the two wires, and it is a good
    > idea to put a resistor (~500 ohm) in series with the stamp pins at
    > the ends of the wires, for protection.
    >
    > -- best regards
    >
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
    >
    >
    >
    > >Hello Martin,
    > >
    > > Thanks for your reply. Obviously you're dealing with a
    > >communication rookie, could you point me to something (tutorial
    maybe) that
    > >I could read to educate myself, or examples?
    > >
    > >Your input is worth much more than 2 cents,
    > >
    > >Tim
    > >
    > >
    > >At 08:54 PM 7/26/2002 +0000, you wrote:
    > >>If you aren't absolutely limited to only 2 lines, 2 more can be
    used
    > >>for handshaking. It's a lot faster checking a bit than waiting
    until
    > >>data arrives, if it does.
    > >>
    > >>#1 -- I want to send on line 3
    > >>#2 -- Check line, sees request, use 4 to say ok, send.
    > >>
    > >>This is way you can sychronize the data without it being real
    time.
    > >>
    > >>My 2 cents.
    > >>-Martin Hebel
    > >>Southern Illinois University
    > > >
    > >>
    > >>--- In basicstamps@y..., Timothy Medema <timm@c...> wrote:
    > >> >
    > >> > Hello All,
    > >> >
    > >> > I'd like to glean some advise from all of the
    experience
    > >> > represented here. I have a project involving two BS2's
    relaying
    > >>machine
    > >> > status back and forth to each other - communication is two-way.
    > >>Neither
    > >> > BS2 knows when the other will "say" or transmit something, the
    > >> > communication is as needed, not at any given time or timing.
    My
    > >>question
    > >> > is: Should I use a programming loop with the SERIN command
    inside a
    > >> > time-out loop and just check for something to be received
    often?
    > >>or, Should
    > >> > I have some kind of memory buffer between the transceiver and
    the
    > >>BS2 to
    > >> > hold received data until the program asks for it? What
    techniques
    > >>have you
    > >> > used and how have they worked?
    > >> >
    > >> > Thank You,
    > >> >
    > >> > Tim
    > >> >
    > >> >
    > >> > Timothy Medema
    > >> > CrystaLite, Incorporated
    > >> > 3307 Cedar St. (425) 745-6000 800-666-6065
    > >> > Everett, WA 98201 Fax: (425) 257-0232
    > >> >
    > >> > www.crystaliteinc.com
    > >> > <mailto:timm@c...>timm@c...
    > >> >
    > >> >
    > >> > The information transmitted is intended only for the person or
    > >>entity to
    > >> > whom it is addressed and may contain confidential and/or
    privileged
    > >> > material. Any review, retransmission, dissemination or other
    use
    > >>of, or
    > >> > taking of any action in reliance upon, this information by
    persons
    > >>or
    > >> > entities other than the intended recipient is prohibited. If
    you
    > >>received
    > >> > this in error, please contact the sender and delete the
    material
    > >>from any
    > >> > computer.
    > >>
    > >>
    > >>To UNSUBSCRIBE, just send mail to:
    > >> basicstamps-unsubscribe@y...
    > >>from the same email address that you subscribed. Text in the
    Subject and
    > >>Body of the message will be ignored.
    > >>
    > >>
    > >>Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >Timothy Medema
    > >CrystaLite, Incorporated
    > >3307 Cedar St. (425) 745-6000 800-666-6065
    > >Everett, WA 98201 Fax: (425) 257-0232
    > >
    > >www.crystaliteinc.com
    > ><mailto:timm@c...>timm@c...
    > >
    > >
    > >The information transmitted is intended only for the person or
    entity to
    > >whom it is addressed and may contain confidential and/or privileged
    > >material. Any review, retransmission, dissemination or other use
    of, or
    > >taking of any action in reliance upon, this information by persons
    or
    > >entities other than the intended recipient is prohibited. If you
    received
    > >this in error, please contact the sender and delete the material
    from any
    > >computer.
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-27 04:20
    You could use the 'addressable' idea to inform a stamp that it's now time to do
    some work and respond. Both stamps would do something like this:

    wait for a special token
    do any required processing
    send result
    send special token

    In order for this to work, you would need to establish a mechanism to determine
    which stamp should talk first. You could do a master/slave kind of thing where
    the programs would be different (so one stamp would always talk first), or you
    could use a random timeout kind of algorithm and let the stamps themselves
    determine who's first (the programs could be the same in this case)

    The stamps would continuously pass the token back and forth, whether or not any
    useful data needed to be sent.

    I have a really bad headache, and I probably shouldn't have tried to answer [noparse]:)[/noparse].
    I hope you find something useful in my answer though...

    Stan



    --- In basicstamps@y..., Timothy Medema <timm@c...> wrote:
    >
    > Hello All,
    >
    > I'd like to glean some advise from all of the experience
    > represented here. I have a project involving two BS2's relaying machine
    > status back and forth to each other - communication is two-way. Neither
    > BS2 knows when the other will "say" or transmit something, the
    > communication is as needed, not at any given time or timing. My question
    > is: Should I use a programming loop with the SERIN command inside a
    > time-out loop and just check for something to be received often? or, Should
    > I have some kind of memory buffer between the transceiver and the BS2 to
    > hold received data until the program asks for it? What techniques have you
    > used and how have they worked?
    >
    > Thank You,
    >
    > Tim
    >
    >
    > Timothy Medema
    > CrystaLite, Incorporated
    > 3307 Cedar St. (425) 745-6000 800-666-6065
    > Everett, WA 98201 Fax: (425) 257-0232
    >
    > www.crystaliteinc.com
    > <mailto:timm@c...>timm@c...
    >
    >
    > The information transmitted is intended only for the person or entity to
    > whom it is addressed and may contain confidential and/or privileged
    > material. Any review, retransmission, dissemination or other use of, or
    > taking of any action in reliance upon, this information by persons or
    > entities other than the intended recipient is prohibited. If you received
    > this in error, please contact the sender and delete the material from any
    > computer.
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-27 20:13
    Hi Tim,

    I didn't realize this was a radio application either. Here are a
    couple more cents to add to what others have said...

    If you do want to use a buffer, which would certainly help, then the
    MAX3100 is a UART that has an 8 byte buffer as well as a pin that
    signals that data is available.

    Another kluge option is to generate a BREAK signal on the transmit
    stamp when it wants to talk to the other. The BREAK simply keys the
    transmitter ON for a second, long enough for the receiving stamp to
    get around to checking its data input pin (which for this scheme to
    work has to be one of the p0 to p15, not p16.) Then when the BREAK
    ends, the ascii communication can begin. I've used that with a modem.

    Or, if the data is not time critical, and if both Stamps have clock
    chips, then they can agree to exchange data at some regular
    interval... synchronize watches please.

    Of course, there is always the problem with radio--bad data--when the
    signal is weak. In which case you still need some kind of
    'addressable' scheme and maybe even a packet scheme with checksums to
    verify the data. The limit of this is the purchase of a TNC or a
    genuine radio modem that has all of the packet creation and
    verification built in.


    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 16:01
    Sid, Martin, Stan and Tracy,

    Thank you for your responses over the weekend. First off, my apologies for
    not making it clearer that my application is wireless! Second, I
    appreciate all of this input, and as a rookie will have to take some time
    to study and try each of the techniques that you present. Most likely,
    I'll be parts of each of them rolled together in the end.

    Sid, Yes your "addressable" idea helps alot. Maybe in a single device
    control situation, this could also be used to identify what the incoming
    data is: If preface is "Bat", then the data that follows represents the
    battery condition or if the preface is "Pos" then the data that follows
    represents the position of some such mechanical beast or something. Thank
    you for including the code example.

    Martin, This sounds like a good and simple way of each "end" getting the
    others attention. Thank you for including your code example.

    Stan, Your ideas too are appreciated. It helps for me to see the concept
    steps written out like you did. I hope you have gotten rid of your
    headache and are feeling better.

    Tracy, Thank you for including the Maxim UART part number for me to look
    into, I'll be downloading the data sheets today. Have you used this chip
    and would you have some BS2 code available? I'm not sure that I understand
    the BREAK signal idea - it implies that the receiving end "sees" or has an
    output change state when the transmitter on the other end keys up. Am I
    understanding this correctly? If so, that could be helpful.

    To All, I know I'm asking alot, but like I said, I'm a rookie - what type
    of error or sum checking schemes have you come up with and would you share
    some code examples?

    Thanks again,

    Tim


    At 12:13 PM 7/27/2002 -0700, you wrote:
    >Hi Tim,
    >
    >I didn't realize this was a radio application either. Here are a
    >couple more cents to add to what others have said...
    >
    >If you do want to use a buffer, which would certainly help, then the
    >MAX3100 is a UART that has an 8 byte buffer as well as a pin that
    >signals that data is available.
    >
    >Another kluge option is to generate a BREAK signal on the transmit
    >stamp when it wants to talk to the other. The BREAK simply keys the
    >transmitter ON for a second, long enough for the receiving stamp to
    >get around to checking its data input pin (which for this scheme to
    >work has to be one of the p0 to p15, not p16.) Then when the BREAK
    >ends, the ascii communication can begin. I've used that with a modem.
    >
    >Or, if the data is not time critical, and if both Stamps have clock
    >chips, then they can agree to exchange data at some regular
    >interval... synchronize watches please.
    >
    >Of course, there is always the problem with radio--bad data--when the
    >signal is weak. In which case you still need some kind of
    >'addressable' scheme and maybe even a packet scheme with checksums to
    >verify the data. The limit of this is the purchase of a TNC or a
    >genuine radio modem that has all of the packet creation and
    >verification built in.
    >
    >
    > -- best regards
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
    >
    >
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 16:35
    In a message dated 7/29/02 11:03:10 Eastern Daylight Time,
    timm@c... writes:


    > Sid, Yes your "addressable" idea helps alot. Maybe in a single device
    > control situation, this could also be used to identify what the incoming
    > data is: If preface is "Bat", then the data that follows represents the
    > battery condition or if the preface is "Pos" then the data that follows
    > represents the position of some such mechanical beast or something. Thank
    > you for including the code example.
    >

    Just remember the the "addresses" are case-sensitive. "Bat" is not the same
    as "bat".

    Sid


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 17:07
    Thanks for pointing that out Sid.

    Tim

    At 11:35 AM 7/29/2002 -0400, you wrote:
    >In a message dated 7/29/02 11:03:10 Eastern Daylight Time,
    >timm@c... writes:
    >
    >
    > > Sid, Yes your "addressable" idea helps alot. Maybe in a single device
    > > control situation, this could also be used to identify what the incoming
    > > data is: If preface is "Bat", then the data that follows represents the
    > > battery condition or if the preface is "Pos" then the data that follows
    > > represents the position of some such mechanical beast or something. Thank
    > > you for including the code example.
    > >
    >
    >Just remember the the "addresses" are case-sensitive. "Bat" is not the same
    >as "bat".
    >
    >Sid
    >
    >
    >[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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 19:11
    >.. MAX3100.. Have you used this chip
    >and would you have some BS2 code available? I'm not sure that I understand
    >the BREAK signal idea - it implies that the receiving end "sees" or has an
    >output change state when the transmitter on the other end keys up. Am I
    >understanding this correctly? If so, that could be helpful.

    Hi Tim,

    You can find some code posted at
    <http://www.emesystems.com/BS2IrDA.htm>. The tutorial there talks
    about the IrDA capabilities of the MAX3100. However, the code will
    work also with standard wired connection. Change the configuration
    word to, say, E04D, instead of C08D; that sets wired connection
    (instead of IrDA), 2 stop bits (instead of 1) and 8-byte FIFO
    enabled. Study the data sheet to understand the options for the
    "write configuration" command. You may want to use an inverter
    between the UART and your radio. I think Al Williams too has some
    MAX3100/stamp information on his web site.

    BREAK is a standard notion in ansychronous serial communication. An
    RS232 line normally rests at negative something volts, and then
    pulses positive briefly to send bytes of data. The data stream is
    punctuated often with stop bits, so the RS232 line never stays at a
    high level for very long. BREAK means bringing the line active on
    purpose for a time much longer than the normal byte period. It might
    be 0.3 second or longer. That would mean you would simply key ON
    your transmitter (HIGH 5[noparse]:p[/noparse]ause 300). The receiver would come around
    periodically and look to see if its receive line is active. If so,
    stays at that point in the program until the line again goes low. At
    that point, an exchange of data can commence. In the nature of short
    range radio communication with low power AM, the receiver will detect
    a lot of noise bursts when the transmitter is off, so there has to be
    a verification step. Another idea that came up in this tread was for
    the transmitter to simply send a certain byte repeatedly until the
    receiver sends back a handshake.

    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 19:16
    http://www.wd5gnr.com/suart.htm is a MAX3110 UART used with a Stamp. Be
    careful: these parts are very difficult to actually buy!

    Al Williams
    AWC
    * Floating point math for the Stamp, PIC, SX, or any microcontroller
    http://www.al-williams.com/awce/pak1.htm


    > >.. MAX3100.. Have you used this chip
    > >and would you have some BS2 code available? I'm not sure that I
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 19:21
    Thank you for your link and additional information Tracy, it's much
    appreciated. I'll check with Al Williams too and get reading!

    Tim


    At 11:11 AM 7/29/2002 -0700, you wrote:
    > >.. MAX3100.. Have you used this chip
    > >and would you have some BS2 code available? I'm not sure that I understand
    > >the BREAK signal idea - it implies that the receiving end "sees" or has an
    > >output change state when the transmitter on the other end keys up. Am I
    > >understanding this correctly? If so, that could be helpful.
    >
    >Hi Tim,
    >
    >You can find some code posted at
    ><http://www.emesystems.com/BS2IrDA.htm>. The tutorial there talks
    >about the IrDA capabilities of the MAX3100. However, the code will
    >work also with standard wired connection. Change the configuration
    >word to, say, E04D, instead of C08D; that sets wired connection
    >(instead of IrDA), 2 stop bits (instead of 1) and 8-byte FIFO
    >enabled. Study the data sheet to understand the options for the
    >"write configuration" command. You may want to use an inverter
    >between the UART and your radio. I think Al Williams too has some
    >MAX3100/stamp information on his web site.
    >
    >BREAK is a standard notion in ansychronous serial communication. An
    >RS232 line normally rests at negative something volts, and then
    >pulses positive briefly to send bytes of data. The data stream is
    >punctuated often with stop bits, so the RS232 line never stays at a
    >high level for very long. BREAK means bringing the line active on
    >purpose for a time much longer than the normal byte period. It might
    >be 0.3 second or longer. That would mean you would simply key ON
    >your transmitter (HIGH 5[noparse]:p[/noparse]ause 300). The receiver would come around
    >periodically and look to see if its receive line is active. If so,
    >stays at that point in the program until the line again goes low. At
    >that point, an exchange of data can commence. In the nature of short
    >range radio communication with low power AM, the receiver will detect
    >a lot of noise bursts when the transmitter is off, so there has to be
    >a verification step. Another idea that came up in this tread was for
    >the transmitter to simply send a certain byte repeatedly until the
    >receiver sends back a handshake.
    >
    > -- best regards
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 19:29
    >http://www.wd5gnr.com/suart.htm is a MAX3110 UART used with a Stamp. Be
    >careful: these parts are very difficult to actually buy!

    I used to avoid all those wonderful MAXIM parts, because they were so
    hard to obtain. But the e-commerce connection direct from
    http://www.maxim-ic.com works great. It is a bit of a pain to sign
    up for at first, but well worth it if you want their esoteric stuff.
    For example, the MAX3100EPD is in stock now. Also, Maxim is very
    generous with samples if you only need a couple for evaluation or for
    a hobby project.

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 20:20
    Al and Tracy,

    I have both sides of that story as well and was even told by a
    national parts distributor not to implement Maxim parts into a production
    product due to inconsistencies in availability of those parts. I also have
    ordered samples from Maxim and find them to be very generous.

    ???

    Tim

    At 11:29 AM 7/29/2002 -0700, you wrote:
    > >http://www.wd5gnr.com/suart.htm is a MAX3110 UART used with a Stamp. Be
    > >careful: these parts are very difficult to actually buy!
    >
    >I used to avoid all those wonderful MAXIM parts, because they were so
    >hard to obtain. But the e-commerce connection direct from
    >http://www.maxim-ic.com works great. It is a bit of a pain to sign
    >up for at first, but well worth it if you want their esoteric stuff.
    >For example, the MAX3100EPD is in stock now. Also, Maxim is very
    >generous with samples if you only need a couple for evaluation or for
    >a hobby project.
    >
    > -- Tracy
    >
    >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.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-29 22:24
    Hello from Gregg C Levine
    Surprise, surprise. It happens that all of my Maxim parts here were
    ordered via their samples phone numbers, and even via their badly
    designed website. The same goes for the Dallas end of their site. Some
    national parts vendors, do not like Maxim because those parts that the
    company makes are, well, strange. Companies such as Mouser, and Digikey,
    and Jameco, love Maxim for the same reasons that have just been
    espoused. Everyone is entitled to an opinion, what happens once you've
    heard the one supplied by the other guy, is up to you.
    Gregg C Levine hansolofalcon@w...
    "The Force will be with you...Always." Obi-Wan Kenobi
    "Use the Force, Luke."· Obi-Wan Kenobi
    (This company dedicates this E-Mail to General Obi-Wan Kenobi )
    (This company dedicates this E-Mail to Master Yoda )



    >
    Original Message
    > From: Timothy Medema [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=wZD8kE29Nki_9-UHAzmLKhBvhLTzX6lh3hdpDIPdx3oo5cLFUlnfNHXfSx9xnVuphUF52BBK_lXzbMy2Dw]timm@c...[/url
    > Sent: Monday, July 29, 2002 3:20 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Re: Communication Buffer??
    >
    >
    > Al and Tracy,
    >
    > I have both sides of that story as well and was even told by
    a
    > national parts distributor not to implement Maxim parts into a
    production
    > product due to inconsistencies in availability of those parts. I also
    have
    > ordered samples from Maxim and find them to be very generous.
    >
    > ???
    >
    > Tim
    >
    > At 11:29 AM 7/29/2002 -0700, you wrote:
    > > >http://www.wd5gnr.com/suart.htm is a MAX3110 UART used with a
    Stamp. Be
    > > >careful: these parts are very difficult to actually buy!
    > >
    > >I used to avoid all those wonderful MAXIM parts, because they were so
    > >hard to obtain. But the e-commerce connection direct from
    > >http://www.maxim-ic.com works great. It is a bit of a pain to sign
    > >up for at first, but well worth it if you want their esoteric stuff.
    > >For example, the MAX3100EPD is in stock now. Also, Maxim is very
    > >generous with samples if you only need a couple for evaluation or for
    > >a hobby project.
    > >
    > > -- Tracy
    > >
    > >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.
    > >
    > >
    > >Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    >
Sign In or Register to comment.