Shop OBEX P1 Docs P2 Docs Learn Events
PUT,GET w/ serin — Parallax Forums

PUT,GET w/ serin

ratronicratronic Posts: 1,451
edited 2007-03-02 18:00 in BASIC Stamp
I am trying to figure out how to use put command with serin command receiving bytes coming in from garmin
oem gps or any other unit. I have figured out the·PUT command ,my problem is using it with the serin command
w/ RS232 bytes comming· in at 19.2 baud. I am using a BS2px chip. I am trying to figure out the syntax for using
the Put command withen the serin command so I can use the 126 bytes of scratch pad ram rather than 26
variable bytes of normal system variable ram. I have figured out a routine using the 26 variable bytes. I have
figured· out using MR Hebels extended serail object routine w/ the propellar chip. I have looked at the basic stamp and didn't find anything
of use. Maybe it can,t be done, so I would appreciate any help stirring me the right direction. Thanks Dave.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Fix it if ain't broke said...
(replace this text with what was said)
D Rat

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-01 22:39
    Look at the SPSTR formatter on page 392 of the PBasic manual. This provides for storage of a received string of characters up to 126 bytes long in the scratchpad RAM. You really cannot use SERIN and PUT separately at 19.2 KBaud. There's just not enough time between characters.
  • ratronicratronic Posts: 1,451
    edited 2007-03-01 23:14
    I think I have different manuel than yours ,I have on parallax 2006 CD but that led me to the spstr command so I will
    delve into that , do you know of examples you could leed me to using the spstr command. Thanks Dave.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke said...
    (replace this text with what was said)
    D Rat
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-01 23:38
    I guess my copy of the manual is a couple of editions older. The latest is V2.2 and the piece on SPSTR is on page 404. I don't have any examples, but it's not very complicated. I suggest you just experiment with it using the DEBUG window. Make up a small test program with a SERIN statement using SPSTR and display the first 8 or 16 bytes of scratchpad RAM before and after the SERIN. You'll quickly see what it does.
  • ratronicratronic Posts: 1,451
    edited 2007-03-02 02:01
    I have seen the spstr command on 404 and other pages but no example using it in the serin command. I just

    can't seem to get the syntax right, I am fairly newbee, I can't just get it right. Attached is a simple raw

    program that I am playing with - can someone show me the right syntax for using the spstr in the serin command?? Thanks Dave.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke said...
    (replace this text with what was said)
    D Rat
  • ratronicratronic Posts: 1,451
    edited 2007-03-02 02:06
    opps the wrong program sorry this the program I am trying.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke said...
    (replace this text with what was said)
    D Rat
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-02 02:18
    I think your SERIN statement is ok. You are missing a NEXT x statement though. What error message are you getting and on what statement?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-03-02 02:46
    Dear D.R.

    There is no backslash int the SPSTR modifier.

    SERIN gpsin,gpsbd,3000,no_data,[noparse][[/noparse]WAIT("GPRMC,"),SPSTR 25]

    not SERIN gpsin,gpsbd,3000,no_data,[noparse][[/noparse]WAIT("GPRMC,"),SPSTR \25]

    Also as Mike said, you need a NEXT to go with your FOR, and with 25 bytes the index will go from 0 to 24. If it branches to "no_data" (which I presume was in your program but not listed), that means something else is wrong!

    When you have a very short program snippet like that or a question on one syntax issue, it is okay to include the code in your post.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • ratronicratronic Posts: 1,451
    edited 2007-03-02 18:00
    Thanks to Mike Green and special thanks to Tracy Allen for showing me the proper syntax , maybe somebody

    else can use this info. I was able to recieve a full sentence using scratch pad ram. I am working on recieving

    another sentence right after word using variable ram. Thanks again, these forums are great when you get stuck.

    Dave.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke said...
    (replace this text with what was said)
    D Rat
Sign In or Register to comment.