Shop OBEX P1 Docs P2 Docs Learn Events
Timing issues with SERIN — Parallax Forums

Timing issues with SERIN

jgannonjgannon Posts: 2
edited 2007-06-27 23:21 in BASIC Stamp
I am trying to read in a reasonably complicated serial string on my BS2e. The command I am using is:
SERIN 16, 16468, [noparse][[/noparse]WAIT("L07 "), DEC command, DEC joint, sign, DEC parameter]


If I manually type:
L07 1 1+99


into the debugging terminal (with a trailing space), I get the expected values in my variables. If I set up a macro to send the same string, it gets hung up waiting for either command or joint. I suspect that this is because of serial timing issues, but I don't really know where to start in order to fix this. Different speed for the port? Different code to handle the strings? Any suggestions are very much appreciated.

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-06-27 20:09
    You're running pretty fast at 9600. The help file notes that at 9600 and 4800 there may be issues.

    You may be able to squeak by if you grab the whole set of data at once with the STR modifier and put the individual parts into an array. for ex: SERIN 16, 16468,[noparse][[/noparse]WAIT ("L07"), STR grab\6]
    Then, check the bytes to see what was received.

    In my experience, 2400 is usually rock-solid and 4800 is doable .

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • jgannonjgannon Posts: 2
    edited 2007-06-27 23:21
    I read through the entire SERIN part of the manual, and somehow skipped right over that suggestion. Even 4800 is a little unstable, but 2400 now works pretty consistently. Thanks for the help!
Sign In or Register to comment.