Go Down

Topic: TinyGPSPlus update frequency (Read 47 times) previous topic - next topic

uttaran

I want to edit the library so that the update frequency is changed without changing baud rate. This is my 1st ever programming but I think I'll only have to change an integer value to get it done.

DrAzzy

What do you mean?

The "standard" GPS devices like you use that library for continually spew data out over serial when powered. You don't get to tell it how fast to send the data. You just have to keep listening and see if anything changes.
ATtiny core for 841+1634+828 and x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny 841/1634/828/88/861/167 breakouts, mosfets, touch sensors and prototyping board in my store http://tindie.com/stores/DrAzzy

aarg

It's also okay to allow TinyGPS to continuously decode data. You aren't forced to use the results continuously, you can read them any time you like.

Also, it is possible to configure some GPS units to send fewer types of NMEA sentences. However, typically that is not a problem and you can just ignore what you don't need, as mentioned above.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

/dev

Quote
The "standard" GPS devices like you use that library for continually spew data out over serial when powered. You don't get to tell it how fast to send the data. You just have to keep listening and see if anything changes.
Actually, most new GPS devices allow you to set the update rate.  5Hz and 10Hz are the typical limits.  

Quote
I want to edit the library so that the update frequency is changed...
The update frequency is not in the library.  You set the update frequency by sending a special command string to the GPS device.  Then the GPS device starts reporting at that rate, instead of the default 1Hz.  But...

Quote
... without changing baud rate.
You probably have to change the baud rate.  For example, at 9600 baud, each character takes ~1ms to be sent from the GPS device.  The GPRMC sentence contains ~80 characters.  To send one GPRMC sentence, it takes about 84ms.  If the update rate is 10Hz, then there are 100ms in each interval, and that's all the time you get to send the sentence.

Most GPS devices will send more than one sentence per update.  GPGGA and GPRMC are the most common, but it's not unusual to see GPGSA, GPGST, or even GPGSV (actually 3 or 4 sentences).  This means there could be 5 or 6 sentences per update interval.  Again, if each sentence is ~80 characters long, the total transmission time for all that data at 9600 would be 5 * 80 * 1.04 = 416ms.  It won't fit in 100ms.

If you turn off all sentences but 1, you might get the GPS device to change the update interval without changing the speed.  Some devices just require it; you don't really have a choice.  Read the spec to be sure.  Here's a table you can use to see which sentences you really need.

BTW, if you're looking for a fast GPS library, you should check out my NeoGPS library.  It's 2x faster and uses much less RAM.

Cheers,
/dev

aarg

Did you want to increase or decrease the update frequency vs. 1Hz?
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy