Shop OBEX P1 Docs P2 Docs Learn Events
Beginner - Baud Rate Question — Parallax Forums

Beginner - Baud Rate Question

ArchiverArchiver Posts: 46,084
edited 2003-12-11 02:23 in General Discussion
I am seeing garbage when using SERIN.

The Basic Stamp Manual v2.0c doesn't have a table on or about p. 277
for baud rates for BSP2e.

I need 1200-8-N-1. I have tried 2063 and many others. No success.

Where are the numbers coming from on page 277 for calculating the bit
period? Specifically, the number around 1,000,000?

Am trying to communicate with a measuring tape. DigiTape Plus by
Starrett. It is trivial using the Debug window with the editor. I
do have to check the DTR control before it works though.

How to wire DTR? RS232 Pin 4 to, say, P11? Is the DTR pin
the "\Fpin""?

Thanks,
Frank

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-12-10 07:55
    At 02:42 AM 12/10/03 +0000, franksmith512 wrote:
    >I am seeing garbage when using SERIN.
    >
    >The Basic Stamp Manual v2.0c doesn't have a table on or about p. 277
    >for baud rates for BSP2e.

    The BS-2pe uses the same BAUDMODES as the original Stamp BS-2 although that's
    not
    evident in my manual either. You may find this web page a handy reference:
    http://www.emesystems.com/BS2rs232.htm#Baudmode


    >I need 1200-8-N-1. I have tried 2063 and many others. No success.

    Hidden away on the L S Starrett web site I found the following baud rate
    information: 4800-7-E-1 and based on that a BAUDMODE of (decimal) 8380 or
    (hex) $20BC would be appropriate. It additionally states that the output is 16
    ASCII characters followed by a CR/LF (carriage return/line feed).

    >Where are the numbers coming from on page 277 for calculating the bit
    >period? Specifically, the number around 1,000,000?

    Those are conversion factors for changing BAUD RATE to BAUDMODE. As you can see
    there is a mathematical relationship between the two with addition bit settings
    as noted in the manual.


    >Am trying to communicate with a measuring tape. DigiTape Plus by
    >Starrett. It is trivial using the Debug window with the editor. I
    >do have to check the DTR control before it works though.
    >
    >How to wire DTR? RS232 Pin 4 to, say, P11? Is the DTR pin
    >the "\Fpin""?

    I would be tempted to try something like this:

    measure VAR BYTE(15) ' reserve 16 bytes (numbered 0-15)
    dump VAR BYTE(1) ' clear CR/LF (may not be absolutely necessary)
    bmode CON 8380 ' 4800-7-E-1
    td CON 1000 ' arbitrary time-out value
    dpin CON 3 ' data pin port (arbitrary)
    fpin CON 4 ' flow control pin port (per your example)

    SERIN dpin\fpin,bmode,td,nodata,[noparse][[/noparse]STR measure\16,dump\2]
    GOTO data_okay
    nodata DEBUG "Data line timed out"


    >Thanks,
    >Frank
    Hope that gives you some more intelligent output.

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-10 22:18
    Thanks Bruce!

    I will give it a try tonight.

    Take care,
    Frank




    --- In basicstamps@yahoogroups.com, Bruce Bates <bvbates@u...> wrote:
    > At 02:42 AM 12/10/03 +0000, franksmith512 wrote:
    > >I am seeing garbage when using SERIN.
    > >
    > >The Basic Stamp Manual v2.0c doesn't have a table on or about p.
    277
    > >for baud rates for BSP2e.
    >
    > The BS-2pe uses the same BAUDMODES as the original Stamp BS-2
    although that's not
    > evident in my manual either. You may find this web page a handy
    reference:
    > http://www.emesystems.com/BS2rs232.htm#Baudmode
    >
    >
    > >I need 1200-8-N-1. I have tried 2063 and many others. No success.
    >
    > Hidden away on the L S Starrett web site I found the following baud
    rate information: 4800-7-E-1 and based on that a BAUDMODE of
    (decimal) 8380 or
    > (hex) $20BC would be appropriate. It additionally states that the
    output is 16 ASCII characters followed by a CR/LF (carriage
    return/line feed).
    >
    > >Where are the numbers coming from on page 277 for calculating the
    bit
    > >period? Specifically, the number around 1,000,000?
    >
    > Those are conversion factors for changing BAUD RATE to BAUDMODE. As
    you can see there is a mathematical relationship between the two with
    addition bit settings as noted in the manual.
    >
    >
    > >Am trying to communicate with a measuring tape. DigiTape Plus by
    > >Starrett. It is trivial using the Debug window with the editor.
    I
    > >do have to check the DTR control before it works though.
    > >
    > >How to wire DTR? RS232 Pin 4 to, say, P11? Is the DTR pin
    > >the "\Fpin""?
    >
    > I would be tempted to try something like this:
    >
    > measure VAR BYTE(15) ' reserve 16 bytes (numbered 0-15)
    > dump VAR BYTE(1) ' clear CR/LF (may not be absolutely
    necessary)
    > bmode CON 8380 ' 4800-7-E-1
    > td CON 1000 ' arbitrary time-out value
    > dpin CON 3 ' data pin port (arbitrary)
    > fpin CON 4 ' flow control pin port (per your example)
    >
    > SERIN dpin\fpin,bmode,td,nodata,[noparse][[/noparse]STR measure\16,dump\2]
    > GOTO data_okay
    > nodata DEBUG "Data line timed out"
    >
    >
    > >Thanks,
    > >Frank
    > Hope that gives you some more intelligent output.
    >
    > Regards,
    >
    > Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-11 02:23
    The \FPin option of SERIN does make a positive difference in my
    tests. I don't get any data unless I use it.

    Starrett must have changed the protocol for the measuring tape.
    Starrett Tech Support says its 1200-N-8-1 which does work perfect
    with the debug window.

    Parallax tech support says I may be facing one of two problems:
    1) The Starrett DigiTape may be parcitic in that it acquires voltage
    from the host. This works fine for a PC connection, but the INix
    1000 24/40 board is also paricitic.

    Soln 1: Use a MAX232 chip

    2) The signal from the Starrett tape may not be >= 8.5 volts.

    Soln 2: Use a MAX232 chip

    While waiting on the MAX232 chip to arrive, I am going to try to
    eavesdrop on the serial cable from the DigiTape to the PC.

    All info is appreciated!

    Thanks,
    Frank
Sign In or Register to comment.