Shop OBEX P1 Docs P2 Docs Learn Events
modify the Parallax GPS code? — Parallax Forums

modify the Parallax GPS code?

CCraigCCraig Posts: 163
edited 2007-06-21 14:45 in General Discussion
I think somebody needs to talk me down. I'm fairly new to the SX, but here it goes.

Anyone modify the Parallax GPS code? Any warnings/hints?
·
I want it to just send: Valid signal code, Latitude and Longitude (from the GPRMC string). I don’t even need E/W, N/S as the app. is land based on this continent.· I wanted Date and Time also (for logging), but I’m worried about data lengths and date/time stamp would be candy.
·
Am I wasting my time because the data comes around fast enough as it is?· AND the data is only coming out of the GPS side once a second. I saw someone’s name in there. Any thoughts? (besides: “You should get back to your project and stop messing with the stuff that already works&#8221[noparse];)[/noparse]
·
I'm guessing I can’t up the baud rate due to the oscillator?
·
My idea is this: My app can start listening, sync on the Valid Code (“A”=valid or “V”=invalid)*, get the numbers and get back to work. I think I’m going to put the date/time stamp on the end of the output string for future use.
·
The GPS unit would continuously send my output string, updated or not. If a program poles for data too fast, there will be a lot of old data duped as new data from the GPS radio side has not been received yet. I will add code if the radio fails/times out, it will catch it.

Anyone solder pins to the GPS unit to attach the Key?
·
Every time I start to do this, I hear a tiny voice in my head say:
·
“STOP…, put the soldering iron DOWN…, raise your hands and back slowly away from the bench.”
·
TIA, Chris
·
* V=invalid, aren’t we supposed to use correct mnemonics? or is this GPS thing a Gov’t project?

Comments

  • JonnyMacJonnyMac Posts: 8,943
    edited 2007-01-25 17:15
    I've done it -- in fact I wrote about it in Nuts & Volts magazine.

    http://www.parallax.com/dl/docs/cols/nv/vol7/col/NV139.pdf

    I've attached the latest version of my code for you to explore; it's setup to make things easy to modify (strip out what you don't want, add new things that you do).

    I did solder a flat, 4-pin header to the module to make attaching the SX-Key easier.

    Post Edited (JonnyMac) : 1/25/2007 5:30:27 PM GMT
  • BeanBean Posts: 8,129
    edited 2007-01-25 17:40
    Chris,
    I have also modified the GPS code. I just soldered a 4 pin header onto the board to reprogram it.
    You CAN increase the sending baud rate. The SX is running @ 20MHz so even 57.6KBaud is do-able.

    If I understand correctly, you want the SX to just keep sending the same data over and over, until new data comes in from the GPS (once a second). Of course the data stream would have to have some kind of header so you would know where the start was. Also you will have to buffer the incoming and outgoing data unless you want one transmission to have some of the old data and some of the new data.

    I think it's do-able. Go for it..

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • James NewtonJames Newton Posts: 329
    edited 2007-01-25 18:44
    Reguarding the Valid Code (“A”=valid or “V”=invalid). It's a graphical thing. The A is an arrow pointing up and the V is an arrow pointing down.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james at sxlist,com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • CCraigCCraig Posts: 163
    edited 2007-01-26 06:04
    Wow, thanks everyone.

    I can't believe that I missed that article. My copy even had one of those tear outs in the middle of the article trying open the magazine to the correct spot. I guess for the New Year, I’ll stop reading N&V in bed waiting for the sandman.

    Jon, I really like the buffer. I’m going to use that great idea. I need to load the buffer more often. You’re only updating it on the “Valid” command. Your article opened my eyes and I’m re-thinking my needs/wants. I can’t tell you how much you’ve helped. We need to kick start a memo and get those links (code and N&V) posted on the GPS product page.

    I’ve already added the posts for the Key.

    Thanks again, Chris
  • JonnyMacJonnyMac Posts: 8,943
    edited 2007-01-26 06:39
    Glad it helped, Chris. Remember, that's pretty easy code -- you could stretch a bit and use ISR driven serial so that the GPS data is constantly buffered; this would give the best response.
  • iramseyiramsey Posts: 12
    edited 2007-02-01 22:00
    So I am new to the GPS receiver and I am doing a project that involves the BS2 and a BOE-bot. I have only been able to initialize the receiver thus far and I want it to collect lat and long data while the robot is in motion. I noticed in the article stated above that the strings can be displayed in the hyper terminal. I am trying to figure out what steps I need to take, (code to write) in order to have the receiver transmit the data to the computer via serial port first and eventually wirelessly to be displayed in the hyperterminal. Are there any other resources that can give this kind of help?
  • CCraigCCraig Posts: 163
    edited 2007-02-02 14:42
    iramsey,

    The output from the GPS is serial data at TTL level, 5 volt. This will require a level shifter like the MAX232 chip to get to the 'real' rs323 levels. (see the article). Sometimes, going straight in to a desktop works, sometimes not. None of mine do.

    The GPS unit, in one mode, can put out all the data strings or can be put in the 'command' mode. I think the command mode would suit you. Please be aware that the BS2 is going to be fairly busy running the servos, etc. and might 'hickup' while waiting for the serial data to return.

    If you know programing semi-well and can solder semi-well, this sounds like an ideal hack for the GPS unit. Using Jon's article, you could piggy back the transmiter to the GPS unit using the un-used 'X' ports in the article. This could give you a self contained unit that upon power up would start transmitting it's lat and long. There would be no need for the BS2 to do anything. But, I would think that you would want to receive instructions back from the desk top, which means a little more work.

    HTH, Chris
  • iramseyiramsey Posts: 12
    edited 2007-02-02 18:34
    Chris,
    Thanks for the help. One last question....if I want to work in RAW mode, do I·HAVE to do my programming on the SX chip, or can I use the basic stamp to run the GPS reciever?
  • BeanBean Posts: 8,129
    edited 2007-02-02 19:03
    In RAW mode, the GPS will just spit out NMEA strings. The SX on the GPS board is not involved.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • JonnyMacJonnyMac Posts: 8,943
    edited 2007-02-05 18:35
    I've attached screen cap from a HyperTerminal session with the Parallax GPS in RAW mode. As Bean indicates, the SX is bypassed in this mode; the RAW input pin controls a little digital switch that routes the GPS data to the SX (smart mode) or directly to the output pin (raw mode).

    Note that these strings are output once per second at 4800 baud.
    859 x 574 - 23K
  • Ben SpratlingBen Spratling Posts: 5
    edited 2007-06-19 18:54
    Howdy,
    I am developing an application for the Parallax GPS module, which I just ordered. I was pleased to find it has an SX on board, since that's the same µC I'm using for my data collection, it's like getting an extra data processor in my system for free!.

    Looking through the code for the GPS module that's posted on the Parallax website (and in the Nuts & Volts column), the routines that give the user's µC the requested data appear to respond only once per second. (Since each request waits for the "!GP..." to come in!) I know GPS only updates once per second, but if I want of the 5 data fields, do I have to wait 5 seconds? This doesn't seem very useful for my app, or any app at all, I would be much more intereted in software that is more responsive.

    I'd like something that caches the incoming data, then repeats back peices when asked (and not in ascii!). I have begun writing such code myself, but I figured I'd ask if anyone else already wrote it, since it would save me development time and the hasstle of figuring out how to use Virtual Peripherals. If no one has come up with such a thing yet, I'll do it myself.
  • JonnyMacJonnyMac Posts: 8,943
    edited 2007-06-19 18:59
    You could modify my Nuts & Volts program such that it parses everything (that you want) at one time. Then create a command set that tells the GPS module to wait for the next received data (up to one second later) or uses the values from the last received string -- shouldn't be very difficult.
  • CCraigCCraig Posts: 163
    edited 2007-06-19 22:40
    That's exactly what I did. Build your string to include the data that you need. I ended up pulling one thing out of the GPGGA string (Alt.) and using most of the GPRMC string (Lat.,Long.,etc.).

    It's very easy to do. A big thanks to Grand and Parallax for making it so.

    Chris
  • Ben SpratlingBen Spratling Posts: 5
    edited 2007-06-20 16:53
    Chris, would you care to post your code?
    -Ben
  • CCraigCCraig Posts: 163
    edited 2007-06-21 02:40
    No problem at all.

    Newbie Alert: this one was one of the very first I had done on the SX.
    This program has seen: edge detect, WDT, you name it, it's been a real learning test bed.

    Sorry about all the power fail detect IF..Then statements. I'll get those back out of there (one of these days).

    Hope you can make sense of it.

    Chris
  • Ben SpratlingBen Spratling Posts: 5
    edited 2007-06-21 14:45
    Thanks. I'm not sure that code will work for my application, but it gave me some ideas.
    -Ben
Sign In or Register to comment.