Shop OBEX P1 Docs P2 Docs Learn Events
BASIC Stamp RS232 serial notes questions — Parallax Forums

BASIC Stamp RS232 serial notes questions

ArchiverArchiver Posts: 46,084
edited 2001-11-19 22:54 in General Discussion
Hi,
I had some questions about networking two of the basic stamps.
1.) On the webpage www.emesystems.com/BS2rs232.htm on Master/slave
scenario #2, how come the serin command is 14\15? I thought pin 14 is
for flow control and and 15 is for data. Is that wrong or is there
some special purpose in doing that? are there any advantages?

serout 15\14,..........
serin 14\15,...........

2.)Also, on that webpage there were no suggestions as far as the
circuitry setup in networking the 2 stamps. I know the BS manual has
3 circuit diagrams: one with flow control, one for open-source, and
one for open-drain. Which circuitry is the best if I want to use flow
control?

3.)If I want to network a BS2 and a BS2SX, are there any extra things
that need to be taken into account such as baud rate and timeouts?.
For instance, can I set both stamps at 9600 baud if I want to?

Any help would be appreciated.

Thanks,
RP

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-11-18 09:18
    Hello,
    I'm not sure I'll be much help but.....

    Original Message
    From: rpsu279@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=cL-r6e8m34IKYHv0nUGU_XJJXaEyFgN-XbI5nYusUtLtiJtBnLS5ITpgxzpXDBmxIAfSr-tpYLYz]rpsu279@y...[/url
    Sent: Saturday, November 17, 2001 1:09 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] BASIC Stamp RS232 serial notes questions


    Hi,
    I had some questions about networking two of the basic stamps.
    1.) On the webpage www.emesystems.com/BS2rs232.htm on Master/slave
    scenario #2, how come the serin command is 14\15? I thought pin 14 is
    for flow control and and 15 is for data. Is that wrong or is there
    some special purpose in doing that? are there any advantages?

    On a BS2SX the a\b part of the serin or serout command represent the same
    thing, that is "a" is the pin number for which you will transmit data and
    "b" is the pin you will use for flow control. If you are serouting from one
    chip with 14\15 then you would most likely serin with 14\15 on the other
    chip. The program you are talking about executes a serout first from the
    master with 15\14, at that same moment the slave is waiting at its serin
    with 15/14. Once this transaction is completed the master changes to serin
    and also changes the pins in which it will use to 14\15 the slave also makes
    these changes and begins its transmission.

    serout 15\14,..........
    serin 14\15,...........

    2.)Also, on that webpage there were no suggestions as far as the
    circuitry setup in networking the 2 stamps. I know the BS manual has
    3 circuit diagrams: one with flow control, one for open-source, and
    one for open-drain. Which circuitry is the best if I want to use flow
    control?

    I'm not sure I know what your asking.

    3.)If I want to network a BS2 and a BS2SX, are there any extra things
    that need to be taken into account such as baud rate and timeouts?.
    For instance, can I set both stamps at 9600 baud if I want to?

    I've never done this, but they appear to use the same code. I don't think
    there will be any problems.

    Hope I helped you!
    Kevin



    Any help would be appreciated.

    Thanks,
    RP



    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 2001-11-19 01:20
    >Hi,
    >I had some questions about networking two of the basic stamps.
    >1.) On the webpage www.emesystems.com/BS2rs232.htm on Master/slave
    >scenario #2, how come the serin command is 14\15? I thought pin 14 is
    >for flow control and and 15 is for data. Is that wrong or is there
    >some special purpose in doing that? are there any advantages?
    >
    > serout 15\14,..........
    > serin 14\15,...........

    Hi RP.

    On of the beauties of the Stamp is that any pin can be used for any
    purpose. That particular master-slave scenario was set up like this:

    serout 15\14,$54,60,bailout,[noparse][[/noparse]"A"] ' *** first BS2, sends data
    | ^
    | | signal directions
    v |
    serin 15\14,$54,2,nodata,[noparse][[/noparse]zork] ' *** second BS2, receives data

    The corresponding pins are connected together by number. But it
    could be done with them cross-connected just as easily.

    Kevin explained the operation well, but here it goes again. When the
    master wants to send a command, it executes the serout command. It
    listens on p14, and if that pin is high, meaning "not ready", it just
    sits there, waiting. It can sit there waiting for up to 60
    milliseconds (a long time in this context). But if p14 goes low, then
    the master sends the command, ascii letter "A" out on p15.

    The slave normally holds p14 at a high level, meaning "I'm not
    ready". Every so often (less than every 60 milliseconds) its main
    loop executes the serin command. When it does so the BS2
    automatically sets p14 low, and that stimulates the master to send
    the "A" command. They then both go about their business, and the
    slave will probably do something with the command. If it happens
    that the slave hits the serin command, and the master is not there,
    the slave quickly (1 millisecond) gives up and goes on with other
    tasks. It come sback within 60 milliseconds to try again.

    In one scenario, the slave can receive a command from the master and
    then send a response. Maybe that is what caused the confusion for
    you? The flow control logic is the same, but the roles are reversed
    for flow control between the master and the slave. Here is the code
    on the master:

    serout 15\14,$54,6000,noslave,[noparse][[/noparse]commands]
    serin 14\15,$54,6000,noslave,[noparse][[/noparse]datas]

    After waiting and sending serout'ing a command, the master turns
    around and inputs the response from the slave. The direction of
    signal flow is the same for both of those commands. p15 is an output
    from the master for both the serout and the serin command. In the
    serout it is the RS232 data output, and in the serin is is the
    handshaking "I am ready" output. On the other hand, p14 is an input
    in both cases: input RS232 data for the serin command, and input
    "are you ready" handshaking for the serout command.

    Because of the versatility of the BS2 pins, there are other ways you
    could do it. I don't recall any advantage to doing it this way.


    >
    >2.)Also, on that webpage there were no suggestions as far as the
    >circuitry setup in networking the 2 stamps. I know the BS manual has
    >3 circuit diagrams: one with flow control, one for open-source, and
    >one for open-drain. Which circuitry is the best if I want to use flow
    >control?


    You can connect p15 to p15 and p14 to p14 directly on the two stamps,
    but I recommend putting a resistor between them, say 470 to 1000
    ohms. That protects them if by mistake, a programming error
    (inevitable!), they are both made outputs and opposite polarity.

    >
    >3.)If I want to network a BS2 and a BS2SX, are there any extra things
    >that need to be taken into account such as baud rate and timeouts?.
    >For instance, can I set both stamps at 9600 baud if I want to?

    The parameters are different for both the baud rates and the
    timesouts. Basically, the BS2sx is 2.5 times faster. The numbers
    are described in the manual. Or ask here if you have specific
    questions.

    Good luck, and I'm glad you found the web page helpful, and I hope I
    did not add to the confusion!

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


    >
    >Any help would be appreciated.
    >
    >Thanks,
    >RP
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-19 22:41
    Hi Tracy,
    Thanks for all your replies. However, I have a question about the
    connection of the two stamps. Here is what you wrote:

    You can connect p15 to p15 and p14 to p14 directly on the two stamps,
    but I recommend putting a resistor between them, say 470 to 1000
    ohms. That protects them if by mistake, a programming error
    (inevitable!), they are both made outputs and opposite polarity.

    How would I put a resistor between them? Do I pullup or pulldown? a
    schematic would help.

    Thanks,
    RP



    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >Hi,
    > >I had some questions about networking two of the basic stamps.
    > >1.) On the webpage www.emesystems.com/BS2rs232.htm on Master/slave
    > >scenario #2, how come the serin command is 14\15? I thought pin 14
    is
    > >for flow control and and 15 is for data. Is that wrong or is there
    > >some special purpose in doing that? are there any advantages?
    > >
    > > serout 15\14,..........
    > > serin 14\15,...........
    >
    > Hi RP.
    >
    > On of the beauties of the Stamp is that any pin can be used for any
    > purpose. That particular master-slave scenario was set up like
    this:
    >
    > serout 15\14,$54,60,bailout,[noparse][[/noparse]"A"] ' *** first BS2, sends data
    > | ^
    > | | signal directions
    > v |
    > serin 15\14,$54,2,nodata,[noparse][[/noparse]zork] ' *** second BS2, receives
    data
    >
    > The corresponding pins are connected together by number. But it
    > could be done with them cross-connected just as easily.
    >
    > Kevin explained the operation well, but here it goes again. When
    the
    > master wants to send a command, it executes the serout command. It
    > listens on p14, and if that pin is high, meaning "not ready", it
    just
    > sits there, waiting. It can sit there waiting for up to 60
    > milliseconds (a long time in this context). But if p14 goes low,
    then
    > the master sends the command, ascii letter "A" out on p15.
    >
    > The slave normally holds p14 at a high level, meaning "I'm not
    > ready". Every so often (less than every 60 milliseconds) its main
    > loop executes the serin command. When it does so the BS2
    > automatically sets p14 low, and that stimulates the master to send
    > the "A" command. They then both go about their business, and the
    > slave will probably do something with the command. If it happens
    > that the slave hits the serin command, and the master is not there,
    > the slave quickly (1 millisecond) gives up and goes on with other
    > tasks. It come sback within 60 milliseconds to try again.
    >
    > In one scenario, the slave can receive a command from the master
    and
    > then send a response. Maybe that is what caused the confusion for
    > you? The flow control logic is the same, but the roles are
    reversed
    > for flow control between the master and the slave. Here is the
    code
    > on the master:
    >
    > serout 15\14,$54,6000,noslave,[noparse][[/noparse]commands]
    > serin 14\15,$54,6000,noslave,[noparse][[/noparse]datas]
    >
    > After waiting and sending serout'ing a command, the master turns
    > around and inputs the response from the slave. The direction of
    > signal flow is the same for both of those commands. p15 is an
    output
    > from the master for both the serout and the serin command. In the
    > serout it is the RS232 data output, and in the serin is is the
    > handshaking "I am ready" output. On the other hand, p14 is an
    input
    > in both cases: input RS232 data for the serin command, and input
    > "are you ready" handshaking for the serout command.
    >
    > Because of the versatility of the BS2 pins, there are other ways
    you
    > could do it. I don't recall any advantage to doing it this way.
    >
    >
    > >
    > >2.)Also, on that webpage there were no suggestions as far as the
    > >circuitry setup in networking the 2 stamps. I know the BS manual
    has
    > >3 circuit diagrams: one with flow control, one for open-source, and
    > >one for open-drain. Which circuitry is the best if I want to use
    flow
    > >control?
    >
    >
    > You can connect p15 to p15 and p14 to p14 directly on the two
    stamps,
    > but I recommend putting a resistor between them, say 470 to 1000
    > ohms. That protects them if by mistake, a programming error
    > (inevitable!), they are both made outputs and opposite polarity.
    >
    > >
    > >3.)If I want to network a BS2 and a BS2SX, are there any extra
    things
    > >that need to be taken into account such as baud rate and timeouts?.
    > >For instance, can I set both stamps at 9600 baud if I want to?
    >
    > The parameters are different for both the baud rates and the
    > timesouts. Basically, the BS2sx is 2.5 times faster. The numbers
    > are described in the manual. Or ask here if you have specific
    > questions.
    >
    > Good luck, and I'm glad you found the web page helpful, and I hope
    I
    > did not add to the confusion!
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
    >
    >
    > >
    > >Any help would be appreciated.
    > >
    > >Thanks,
    > >RP
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-19 22:44
    Hi Tracy,
    Thanks for all your replies. However, I have a question about the
    connection of the two stamps. Here is what you wrote:

    You can connect p15 to p15 and p14 to p14 directly on the two stamps,
    but I recommend putting a resistor between them, say 470 to 1000
    ohms. That protects them if by mistake, a programming error
    (inevitable!), they are both made outputs and opposite polarity.

    How would I put a resistor between them? Do I pullup or pulldown? a
    schematic would help.

    Thanks,
    RP



    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >Hi,
    > >I had some questions about networking two of the basic stamps.
    > >1.) On the webpage www.emesystems.com/BS2rs232.htm on Master/slave
    > >scenario #2, how come the serin command is 14\15? I thought pin 14
    is
    > >for flow control and and 15 is for data. Is that wrong or is there
    > >some special purpose in doing that? are there any advantages?
    > >
    > > serout 15\14,..........
    > > serin 14\15,...........
    >
    > Hi RP.
    >
    > On of the beauties of the Stamp is that any pin can be used for any
    > purpose. That particular master-slave scenario was set up like
    this:
    >
    > serout 15\14,$54,60,bailout,[noparse][[/noparse]"A"] ' *** first BS2, sends data
    > | ^
    > | | signal directions
    > v |
    > serin 15\14,$54,2,nodata,[noparse][[/noparse]zork] ' *** second BS2, receives
    data
    >
    > The corresponding pins are connected together by number. But it
    > could be done with them cross-connected just as easily.
    >
    > Kevin explained the operation well, but here it goes again. When
    the
    > master wants to send a command, it executes the serout command. It
    > listens on p14, and if that pin is high, meaning "not ready", it
    just
    > sits there, waiting. It can sit there waiting for up to 60
    > milliseconds (a long time in this context). But if p14 goes low,
    then
    > the master sends the command, ascii letter "A" out on p15.
    >
    > The slave normally holds p14 at a high level, meaning "I'm not
    > ready". Every so often (less than every 60 milliseconds) its main
    > loop executes the serin command. When it does so the BS2
    > automatically sets p14 low, and that stimulates the master to send
    > the "A" command. They then both go about their business, and the
    > slave will probably do something with the command. If it happens
    > that the slave hits the serin command, and the master is not there,
    > the slave quickly (1 millisecond) gives up and goes on with other
    > tasks. It come sback within 60 milliseconds to try again.
    >
    > In one scenario, the slave can receive a command from the master
    and
    > then send a response. Maybe that is what caused the confusion for
    > you? The flow control logic is the same, but the roles are
    reversed
    > for flow control between the master and the slave. Here is the
    code
    > on the master:
    >
    > serout 15\14,$54,6000,noslave,[noparse][[/noparse]commands]
    > serin 14\15,$54,6000,noslave,[noparse][[/noparse]datas]
    >
    > After waiting and sending serout'ing a command, the master turns
    > around and inputs the response from the slave. The direction of
    > signal flow is the same for both of those commands. p15 is an
    output
    > from the master for both the serout and the serin command. In the
    > serout it is the RS232 data output, and in the serin is is the
    > handshaking "I am ready" output. On the other hand, p14 is an
    input
    > in both cases: input RS232 data for the serin command, and input
    > "are you ready" handshaking for the serout command.
    >
    > Because of the versatility of the BS2 pins, there are other ways
    you
    > could do it. I don't recall any advantage to doing it this way.
    >
    >
    > >
    > >2.)Also, on that webpage there were no suggestions as far as the
    > >circuitry setup in networking the 2 stamps. I know the BS manual
    has
    > >3 circuit diagrams: one with flow control, one for open-source, and
    > >one for open-drain. Which circuitry is the best if I want to use
    flow
    > >control?
    >
    >
    > You can connect p15 to p15 and p14 to p14 directly on the two
    stamps,
    > but I recommend putting a resistor between them, say 470 to 1000
    > ohms. That protects them if by mistake, a programming error
    > (inevitable!), they are both made outputs and opposite polarity.
    >
    > >
    > >3.)If I want to network a BS2 and a BS2SX, are there any extra
    things
    > >that need to be taken into account such as baud rate and timeouts?.
    > >For instance, can I set both stamps at 9600 baud if I want to?
    >
    > The parameters are different for both the baud rates and the
    > timesouts. Basically, the BS2sx is 2.5 times faster. The numbers
    > are described in the manual. Or ask here if you have specific
    > questions.
    >
    > Good luck, and I'm glad you found the web page helpful, and I hope
    I
    > did not add to the confusion!
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
    >
    >
    > >
    > >Any help would be appreciated.
    > >
    > >Thanks,
    > >RP
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-19 22:45
    Hi Tracy,
    Thanks for all your replies. However, I have a question about the
    connection of the two stamps. Here is what you wrote:

    You can connect p15 to p15 and p14 to p14 directly on the two stamps,
    but I recommend putting a resistor between them, say 470 to 1000
    ohms. That protects them if by mistake, a programming error
    (inevitable!), they are both made outputs and opposite polarity.

    How would I put a resistor between them? Do I pullup or pulldown? a
    schematic would help.

    Thanks,
    RP



    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >Hi,
    > >I had some questions about networking two of the basic stamps.
    > >1.) On the webpage www.emesystems.com/BS2rs232.htm on Master/slave
    > >scenario #2, how come the serin command is 14\15? I thought pin 14
    is
    > >for flow control and and 15 is for data. Is that wrong or is there
    > >some special purpose in doing that? are there any advantages?
    > >
    > > serout 15\14,..........
    > > serin 14\15,...........
    >
    > Hi RP.
    >
    > On of the beauties of the Stamp is that any pin can be used for any
    > purpose. That particular master-slave scenario was set up like
    this:
    >
    > serout 15\14,$54,60,bailout,[noparse][[/noparse]"A"] ' *** first BS2, sends data
    > | ^
    > | | signal directions
    > v |
    > serin 15\14,$54,2,nodata,[noparse][[/noparse]zork] ' *** second BS2, receives
    data
    >
    > The corresponding pins are connected together by number. But it
    > could be done with them cross-connected just as easily.
    >
    > Kevin explained the operation well, but here it goes again. When
    the
    > master wants to send a command, it executes the serout command. It
    > listens on p14, and if that pin is high, meaning "not ready", it
    just
    > sits there, waiting. It can sit there waiting for up to 60
    > milliseconds (a long time in this context). But if p14 goes low,
    then
    > the master sends the command, ascii letter "A" out on p15.
    >
    > The slave normally holds p14 at a high level, meaning "I'm not
    > ready". Every so often (less than every 60 milliseconds) its main
    > loop executes the serin command. When it does so the BS2
    > automatically sets p14 low, and that stimulates the master to send
    > the "A" command. They then both go about their business, and the
    > slave will probably do something with the command. If it happens
    > that the slave hits the serin command, and the master is not there,
    > the slave quickly (1 millisecond) gives up and goes on with other
    > tasks. It come sback within 60 milliseconds to try again.
    >
    > In one scenario, the slave can receive a command from the master
    and
    > then send a response. Maybe that is what caused the confusion for
    > you? The flow control logic is the same, but the roles are
    reversed
    > for flow control between the master and the slave. Here is the
    code
    > on the master:
    >
    > serout 15\14,$54,6000,noslave,[noparse][[/noparse]commands]
    > serin 14\15,$54,6000,noslave,[noparse][[/noparse]datas]
    >
    > After waiting and sending serout'ing a command, the master turns
    > around and inputs the response from the slave. The direction of
    > signal flow is the same for both of those commands. p15 is an
    output
    > from the master for both the serout and the serin command. In the
    > serout it is the RS232 data output, and in the serin is is the
    > handshaking "I am ready" output. On the other hand, p14 is an
    input
    > in both cases: input RS232 data for the serin command, and input
    > "are you ready" handshaking for the serout command.
    >
    > Because of the versatility of the BS2 pins, there are other ways
    you
    > could do it. I don't recall any advantage to doing it this way.
    >
    >
    > >
    > >2.)Also, on that webpage there were no suggestions as far as the
    > >circuitry setup in networking the 2 stamps. I know the BS manual
    has
    > >3 circuit diagrams: one with flow control, one for open-source, and
    > >one for open-drain. Which circuitry is the best if I want to use
    flow
    > >control?
    >
    >
    > You can connect p15 to p15 and p14 to p14 directly on the two
    stamps,
    > but I recommend putting a resistor between them, say 470 to 1000
    > ohms. That protects them if by mistake, a programming error
    > (inevitable!), they are both made outputs and opposite polarity.
    >
    > >
    > >3.)If I want to network a BS2 and a BS2SX, are there any extra
    things
    > >that need to be taken into account such as baud rate and timeouts?.
    > >For instance, can I set both stamps at 9600 baud if I want to?
    >
    > The parameters are different for both the baud rates and the
    > timesouts. Basically, the BS2sx is 2.5 times faster. The numbers
    > are described in the manual. Or ask here if you have specific
    > questions.
    >
    > Good luck, and I'm glad you found the web page helpful, and I hope
    I
    > did not add to the confusion!
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
    >
    >
    > >
    > >Any help would be appreciated.
    > >
    > >Thanks,
    > >RP
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-19 22:54
    >Hi Tracy,
    >Thanks for all your replies. However, I have a question about the
    >connection of the two stamps. Here is what you wrote:
    >
    >You can connect p15 to p15 and p14 to p14 directly on the two stamps,
    >but I recommend putting a resistor between them, say 470 to 1000
    >ohms. That protects them if by mistake, a programming error
    >(inevitable!), they are both made outputs and opposite polarity.
    >
    >How would I put a resistor between them? Do I pullup or pulldown? a
    >schematic would help.
    >
    >Thanks,
    >RP
    >...>
    >> serout 15\14,$54,60,bailout,[noparse][[/noparse]"A"] ' *** first BS2, sends data
    >> | ^
    >> | | signal directions
    >> v |
    > > serin 15\14,$54,2,nodata,[noparse][[/noparse]zork] ' *** second BS2, receives



    Sure:

    BS2 master BS2 slave
    _____, ,_______
    | 1k |
    p15|---/\/\----|p15
    | |
    p14|---/\/\----|p14
    | 1k |
    | |
    | |

    p15 is physical pin 20, and p14 is physical pin 19 on the BS2-IC. It
    is neither pullup nor pulldown--it is just straight across.

    -- Tracy
Sign In or Register to comment.