Shop OBEX P1 Docs P2 Docs Learn Events
rs2332 and vga — Parallax Forums

rs2332 and vga

ratronicratronic Posts: 1,451
edited 2007-01-27 20:09 in Propeller 1
Can someone point me in the right direction. ·I am trying to interface a Garmin pc18 OEM GPS. I am new to this and need to learn about printing to vga_text from serial_fullduplex and also how to build and parse strings. Thanks for any help. Dave

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
D Rat

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-27 03:15
    What does it use for a delimiter between values? Commas or spaces or tabs?

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • ratronicratronic Posts: 1,451
    edited 2007-01-27 03:19
    It uses comas and string ends with a carriage return.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-27 03:22
    And the values are floating point (decimal places?)
    I think later this evening I am going to make some modifications to my Extended_FullDuplexSpin to allow accepting values with different delimiters.

    If you can post a sample string I could test with, I can test it some.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • ratronicratronic Posts: 1,451
    edited 2007-01-27 03:43
    "$GPRMC,235255,A,3524.3873,N,11901.4907,W,001.1,155.3,250107,014.0,E,A*04" is a string ending with a carriage return. Can you point me in the right direcion? Or point me to an example to learn from? I am disabled and it takes me 6 times longer to type than most 1 fingered typist. Thanks again Dave




    =

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-27 04:47
    Let me modify a library I have going and see if I can capture the string properly, and give you some code to start with.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • ratronicratronic Posts: 1,451
    edited 2007-01-27 04:52
    Thanks, I will look forward to it! Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-27 06:40
    I've adapted "Extended_FDSerial" to allow the following:
    - Parsing based on defined delimiters
    - Returning from a string the integer or whole value ("-123.456") returns -123
    - Returning from a string the fractional value ("-123.456") returns 456
    I though about trying to incorporate the floating point library, but with an AND or two, values can be checked, and these values can be used to pass to the floating point if need be.

    Anyway, back to the question at hand. The following code accepts a string you defined, parses it into a bunch of strings, and from there you can do as you like with the values.

     Serial.start(31,30,0,9600)
     serial.SetDelimiter(",")
     serial.rxflush
     repeat
        repeat while (serial.rx <> "$")     ' wait for $ at start of string
        serial.RxStrTime(1,@dataStr1)       ' accept each with 1 mS timeout
        serial.RxStrTime(1,@dataStr2)
        serial.RxStrTime(1,@dataStr3)
        serial.RxStrTime(1,@dataStr4)
        serial.RxStrTime(1,@dataStr5)
        serial.RxStrTime(1,@dataStr6)
        serial.RxStrTime(1,@dataStr7)
        serial.RxStrTime(1,@dataStr8)
        serial.RxStrTime(1,@dataStr9)
        serial.RxStrTime(1,@dataStr10)
        serial.RxStrTime(1,@dataStr11)
        serial.RxStrTime(1,@dataStr12)
        serial.RxStrTime(1,@dataStr13)
         
        Serial.str(@dataStr4)              ' display 4th point as string
        Serial.tx(13)                      ' carriage return
         
        i := serial.IntOfString(@dataStr4)   ' get integer portion of string 4
        f := serial.FracOfString(@dataStr4)  ' get fractional portion of string 4
         
        serial.dec(i)                        ' display integer portion
        serial.tx(13)
        serial.dec(f)                        ' display fractional portion
        serial.tx(13)
    
    




    Attached is the test file and the library objects required. Hope this helps!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-27 06:41
    Note that my example uses the programming pins for serial data with the computer - the hardware side wasn't discussed here.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • LarryLarry Posts: 212
    edited 2007-01-27 07:46
    Martin, D Rat

    be aware that the sentence can be different depending on mode with some recievers.
    I'm not sure about your OEM version.
    See www.werple.net.au/~gnb/gps/nmea.html
    also, fwiw, NMEA standard is 4800,8,n,1
    Baddeley said...



    $GPRMC

    Recommended minimum specific GPS/Transit data

    eg1. $GPRMC,081836,A,3751.65,S,14507.36,E,000.0,360.0,130998,011.3,E*62
    eg2. $GPRMC,225446,A,4916.45,N,12311.12,W,000.5,054.7,191194,020.3,E*68


    225446 Time of fix 22:54:46 UTC
    A Navigation receiver warning A = Valid position, V = Warning
    4916.45,N Latitude 49 deg. 16.45 min. North
    12311.12,W Longitude 123 deg. 11.12 min. West
    000.5 Speed over ground, Knots
    054.7 Course Made Good, degrees true
    191194 UTC Date of fix, 19 November 1994
    020.3,E Magnetic variation, 20.3 deg. East
    *68 mandatory checksum


    eg3. $GPRMC,220516,A,5133.82,N,00042.24,W,173.8,231.8,130694,004.2,W*70
    1 2 3 4 5 6 7 8 9 10 11 12


    1 220516 Time Stamp
    2 A validity - A-ok, V-invalid
    3 5133.82 current Latitude
    4 N North/South
    5 00042.24 current Longitude
    6 W East/West
    7 173.8 Speed in knots
    8 231.8 True course
    9 130694 Date Stamp
    10 004.2 Variation
    11 W East/West
    12 *70 checksum


    eg4. for NMEA 0183 version 3.00 active the Mode indicator field is added
    $GPRMC,hhmmss.ss,A,llll.ll,a,yyyyy.yy,a,x.x,x.x,ddmmyy,x.x,a,m*hh
    Field #
    1 = UTC time of fix
    2 = Data status (A=Valid position, V=navigation receiver warning)
    3 = Latitude of fix
    4 = N or S of longitude
    5 = Longitude of fix
    6 = E or W of longitude
    7 = Speed over ground in knots
    8 = Track made good in degrees True
    9 = UTC date of fix
    10 = Magnetic variation degrees (Easterly var. subtracts from true course)
    11 = E or W of magnetic variation
    12 = Mode indicator, (A=Autonomous, D=Differential, E=Estimated, N=Data not valid)
    13 = Checksum

    Larry

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • ratronicratronic Posts: 1,451
    edited 2007-01-27 17:34
    Thank you Matin,· that will keep me busy for awhile. I am sure I will have question(s).· Dave.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
  • ratronicratronic Posts: 1,451
    edited 2007-01-27 18:18
    I can't get the proper syntax right to print to the 4x20 LCD·and/or·vga_text for·the captured strings.

    Thanx ahead of time. Dave.



    P.S. I am thinking of getting the AppleBee modules for my BoeBot.

















    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-27 18:18
    Hi Larry,
    Thanks for the input. The routine is flexible enough so that you don't have to collect all the data, and if you ask for too much, it will timeout. Also, the Baud rate is easily adjusted. This object was written to be generic, and I've been meaning to modify the original, and D Rat's need was just a really good one to test with.

    Good luck D.,
    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-27 18:23
    I haven't done much with VGA lately, but for the TV it would something like:
    TV.str(@datapt4)

    I'll let someone else take it from here for these [noparse]:)[/noparse]

    The AppBee/XBee's are cool. I'm with my students right now and we are working on a StampPlot based control panel to control up to 3 at once, manually or switch to autonomous.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • ratronicratronic Posts: 1,451
    edited 2007-01-27 18:36
    Thanx . I will learn something from this. Dave.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
  • parts-man73parts-man73 Posts: 830
    edited 2007-01-27 20:09
    Martin Hebel said...
    I haven't done much with VGA lately, but for the TV it would something like:
    TV.str(@datapt4)

    I have found most applications for text using the TV can easily be converted to VGA simply by changing the Object declarations. There was a demo program that echoed keyboard input to a screen (in hex), I simply changed the Object from TV_Text to VGA_Text, and it worked without changing any other lines of code (except the Start routine, you need to change the basepin)

    All of the routines in the Objects are identical in name and function.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian Meade

    "They who dream by day are cognizant of many things which escape those who dream only by night" - Edgar Poe
Sign In or Register to comment.