Shop OBEX P1 Docs P2 Docs Learn Events
SerIn at 10400bps — Parallax Forums

SerIn at 10400bps

ArchiverArchiver Posts: 46,084
edited 2002-11-25 04:03 in General Discussion
Hi,
Does somebody know how I can send and receive data at 10400bps with the
BS2? I don't know how to set the baudrate at this speed. The data is 8bits no
parity, 1 stop (with line driver and inverted). Thank you very much

Eze

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

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-11-24 15:03
    Page 277 of the basic stamp manual gives a some pretty straight forward
    tables for computing baud rate. It shows you how to compute it by hand.

    You can compute it for 104000 but as best i am not sure how high the bs2
    will go.
    I was under the impression that it would only do 9600 but on page 274 of the
    manual it says 243 - 50,000. Someone please jump in and verify this.

    for 10400bps on bs2 you would do:

    int(1000000 / 10400) - 20
    + 0 8bit/no-parity
    + 16384 inverted polarity
    16460

    so you would say
    serin the_pin, 16460, [noparse][[/noparse]SerData] 'baud too high for bs2?

    basic stamp manual - see page 277:
    i did myself a huge favor by reading the entire serin section.
    http://www.parallax.com/Downloads/Documentation/BASIC%20Stamp%20Manual%20v2.
    0.pdf

    mkl

    Original Message
    From: "Ezequiel Leonardo Aceto" <Nik@i...>
    To: <basicstamps@yahoogroups.com>
    Sent: Sunday, November 24, 2002 7:35 AM
    Subject: [noparse][[/noparse]basicstamps] SerIn at 10400bps


    > Hi,
    > Does somebody know how I can send and receive data at 10400bps with
    the BS2? I don't know how to set the baudrate at this speed. The data is
    8bits no parity, 1 stop (with line driver and inverted). Thank you very much
    >
    > Eze
    >
    > [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-11-25 00:04
    In inverted mode, Does 5V means "logic 1" and 0V means "logic 0"?
    Thanks,
    Ezequiel

    Original Message
    From: "Matt Lorenz" <mklorenz@c...>
    To: <basicstamps@yahoogroups.com>
    Sent: Sunday, November 24, 2002 12:03 PM
    Subject: Re: [noparse][[/noparse]basicstamps] SerIn at 10400bps


    > Page 277 of the basic stamp manual gives a some pretty straight forward
    > tables for computing baud rate. It shows you how to compute it by hand.
    >
    > You can compute it for 104000 but as best i am not sure how high the bs2
    > will go.
    > I was under the impression that it would only do 9600 but on page 274 of
    the
    > manual it says 243 - 50,000. Someone please jump in and verify this.
    >
    > for 10400bps on bs2 you would do:
    >
    > int(1000000 / 10400) - 20
    > + 0 8bit/no-parity
    > + 16384 inverted polarity
    >
    > 16460
    >
    > so you would say
    > serin the_pin, 16460, [noparse][[/noparse]SerData] 'baud too high for bs2?
    >
    > basic stamp manual - see page 277:
    > i did myself a huge favor by reading the entire serin section.
    >
    http://www.parallax.com/Downloads/Documentation/BASIC%20Stamp%20Manual%20v2.
    > 0.pdf
    >
    > mkl
    >
    >
    Original Message
    > From: "Ezequiel Leonardo Aceto" <Nik@i...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Sunday, November 24, 2002 7:35 AM
    > Subject: [noparse][[/noparse]basicstamps] SerIn at 10400bps
    >
    >
    > > Hi,
    > > Does somebody know how I can send and receive data at 10400bps
    with
    > the BS2? I don't know how to set the baudrate at this speed. The data is
    > 8bits no parity, 1 stop (with line driver and inverted). Thank you very
    much
    > >
    > > Eze
    > >
    > > [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/
    > >
    > >
    >
    >
    > 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-11-25 04:03
    >In inverted mode, Does 5V means "logic 1" and 0V means "logic 0"?
    >Thanks,
    >Ezequiel

    Hi Ezequiel,

    The opposite.

    Inverted mode usually means that 0 volts (or negative volts as in
    RS232) is the "logic 1" or "marking" state. And +5 volts (or
    generally positive >3 volts for RS232) is the "logic 0" or "spacing"
    state.

    That is true for the Stamp. For p0 to p15 and the "inverted" baud
    modes, the pin rests at 0 volts when nothing is going on, between
    transmissions. That is the logic 1 state, and that sometimes
    confuses people, but RS232 always rests in the logic 1, marking
    state. The start bit is logic 0 (+5 volts) and so on, data is
    transmitted lsb first, with logic zero bits being +5 volts and logic
    1 bits being zero volts. The byte is followed by at least 1 stop bit
    back at logic 1 level, zero volts, and there the level stays until
    the next transmission.

    In non-inverted baud modes logic 1 is represented by +5 volts. Get
    it!-->-non-inverted, logic 1, +5 volts. The trick is to remember
    that the RS232 line always rests in the logic 1 state, +5 volts in
    the non-inverted case.

    If you are connecting a BASIC Stamp directly to another RS232 device,
    use the inverted mode, but if you are going through an inverting line
    driver, then use the non-inverted baud mode (because the driver will
    invert it).

    Finally, p16 on the Stamps is a special case, because it has a
    built-in inverting line driver. It transmits with inverting logic
    (resting at the low level, logic 1), no matter what baud mode you use
    in your program. For example, it does not matter if you use $54 or
    $4054. Either one will be inverted at P16. That number does affect
    the sense of the flow control pin though, if you are using that
    option of the SERIN and SEROUT command.

    -- regards,
    Tracy
Sign In or Register to comment.