How do GPS modules store the satellite orbit data? - Page 1
Forum section: electronics / general

author: peter-h
author_rank: Super Contributor
timestamp: May 09, 2025, 09:59:47 pm
content: For example the NEO-M9N. I am sure it has no battery backed RAM, and an EEPROM would wear out too fast.So these modules must be doing a cold start each time. That should take 12.5 mins, but the reality is they are far faster in getting a fix.How does this work?

author: Peabody
author_rank: Super Contributor
timestamp: May 09, 2025, 10:42:53 pm
content: The $13 GoouuuTech module I got from Amazon a couple years ago has an EEPROM, a 24C32. I don't know exactly how it all works, but the time from power up until the LED starts blinking at 1Hz seems to depend on how long ago it was powered down. I guess the longer it has been away, the more satellites it needs to acquire. Something like that.https://www.amazon.com/dp/B07P8YMVNTBy the way, for $13 you get a genuine GoouuuTech module, not some cheap imitation.

author: David Hess
author_rank: Super Contributor
timestamp: May 09, 2025, 11:01:25 pm
content: Quote from: peter-h on May 09, 2025, 09:59:47 pmEEPROM would not wear out too quickly, especially if a log type of data structure was used.I wonder how often the data for each satellite is updated.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 09, 2025, 11:10:56 pm
content: The NEO-M9N module does have a pin for using an external backup battery. I don't know how you integrated it. If you claim no battery backup, then I'm assuming you didn't connect this pin to a battery in your system.If not, the module has a "software backup" mode, which basically saves the data to internal flash. It's described, although poorly, in the manuals (there are several of them apart from the datasheet). The software backup is triggered by a command as far as I can tell, so here again, unless you explicitely triggered a backup, it shouldn't happen.Now I vaguely recall that you may be using this module for getting GPS time? If so, then you don't need a "fix", and no surprise you get a first time message pretty fast. I think it only needs one satellite, so as long as reception conditions are not too bad, you should get a first message with time in a matter of a few seconds only after power-on.If, OTOH, you're talking about a full fix, then that's another matter. But 12.5 min? Are you sure? Where did you get this figure from?

author: langwadt
author_rank: Super Contributor
timestamp: May 09, 2025, 11:20:33 pm
content: Quote from: SiliconWizard on May 09, 2025, 11:10:56 pmhttps://en.wikipedia.org/wiki/Time_to_first_fix

author: amyk
author_rank: Super Contributor
timestamp: May 10, 2025, 04:36:23 am
content: Also from that article:Quote from: https://en.wikipedia.org/wiki/Time_to_first_fix

author: peter-h
author_rank: Super Contributor
timestamp: May 10, 2025, 05:25:26 am
content: Indeed I use it for time, but in the http server status page there is a position link created also.Not implemented a battery; they always fail after some years (in the 10-20 timeframe, for lithium primary cells) and go short-circuit, so completely stopping the device working unless measures are taken (mostly, in consumer products, they are not taken).So this module should be doing a cold start every time. I've just timed a cold-started NEO-M9N at 3:45 and that is a very poor scenario indoors. This is to a 3D fix, too.What prompted me to post the question is that I am testing a particular aviation gadget (a Sky Echo 2) whose GPS appears to be spectacularly crap.

author: reodor
author_rank: Contributor
timestamp: May 10, 2025, 08:13:24 am
content: Flash can handle a huge number of writes. They have flash based hard disks nowadays.If you implement brown-out detection and a large enough capacitor, you may be able to save the data to flash only at power off.

author: peter-h
author_rank: Super Contributor
timestamp: May 10, 2025, 08:34:12 am
content: Sure but this is a little module. No room for a big cap...

author: brucehoult
author_rank: Super Contributor
timestamp: May 10, 2025, 08:35:40 am
content: Quote from: reodor on May 10, 2025, 08:13:24 amOr once every six months when the almanac changes.It's been quite some time since I used a GPS without a cellular network (which allows almost instantly knowing the time and the location of at least the tower you're talking to, and triangulated from several if you're not in the mountains). My original Cambridge GPSNAV (https://www.cumulus-soaring.com/store/cai-gps-nav) in 1994 had only an 8 channel receiver and took some time to get an initial fix if you hadn't used it for six months, and almost as long if you'd travelled to the other side of the world. Once it was upgraded to a 12 channel engine it was much faster. I have an original Garmin eTrex which was 12 channel from the start. I remember using it to find my way across Chicago (driving) to my host's house in 2001 -- no maps, just a pointer and distance. I don't remember using it since I got an iPhone 3GS in 2009 :-)

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 10, 2025, 02:59:29 pm
content: Yes, if you don't want to use a backup battery, you can use the "software backup" feature as I mentioned. It's a command to send to the module. It only needs to be updated every 6 months indeed so there's no way it would wear out the internal flash. It should decrease the TTF to 20-30 s max, even shorter outdoors.But the NEO modules are pretty good and a lot of cheaper GPS modules out there have much worse performance. The antenna plays a big role too.

author: Benta
author_rank: Super Contributor
timestamp: May 10, 2025, 06:24:19 pm
content: Why would an EEPROM wear out too fast?Real EEPROMS (not Flash) can be written at least 100k times and have data retention time spanning decades. With wear-levelling algorithms I see no reliability problems.

author: Andy Chee
author_rank: Super Contributor
timestamp: May 11, 2025, 05:18:11 am
content: Sure, if you buy just the chip or die, there will be no battery.But as an eBay/Amazon module, hopefully there is one like this (button battery top left PCB);Alternatively, perhaps you can implement power management in your off-board microcontroller i.e. a large reservoir capacitor, power-fail detection, and save data on power-loss.

author: Peabody
author_rank: Super Contributor
timestamp: May 11, 2025, 01:51:26 pm
content: My module has both an EEPROM and a button cell. The module is several years old, and I can't measure any voltage on the cell, which appears to have three tiny spot welds on the top connector, so would not be replaceable. But it still seems to work ok.

author: tszaboo
author_rank: Super Contributor
timestamp: May 11, 2025, 02:40:45 pm
content: Quote from: reodor on May 10, 2025, 08:13:24 amYes these modules usually have several megabytes of flash. Ephemeris data is ~ kilobytes, and you can use them for quite some time.So if you have a buffer for it, with a hundred slots, then overwrite it thousands of times, it will work practically forever.

author: peter-h
author_rank: Super Contributor
timestamp: May 11, 2025, 04:34:00 pm
content: It is nontrivial to arrange a data save every 6 months in an embedded system which has say a 3 day supercap backup for the RTC, and no internet accessI think in some situations one would trigger a save on every power-down, depending on how long it takes (only if there is a current GPS fix obviously).

author: Siwastaja
author_rank: Super Contributor
timestamp: May 11, 2025, 05:31:59 pm
content: Quote from: peter-h on May 11, 2025, 04:34:00 pmWhy would that matter, though? Here's a simple algorithm: once full set of almanac has been received, compare to the existing in flash. If identical, don't write. If not, write. This way it will be written again every 6 months. After boot, and before the new almanac has been received, try to use the one existing in flash. If it has been expired during longer off-time, then getting the fix for the first time will be slower.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 11, 2025, 06:03:31 pm
content: Quote from: peter-h on May 11, 2025, 04:34:00 pmYou get the time and date from GPS. You just need to store the last save date and compute how much time has elapsed since the last save when the device gets a date from GPS.What did I miss?

author: ejeffrey
author_rank: Super Contributor
timestamp: May 11, 2025, 06:57:06 pm
content: Quote from: peter-h on May 11, 2025, 04:34:00 pmIt's a GPS! You don't need a battery backed RTC. You would only consider writing the backup when you have accurate time from the satellites.

author: langwadt
author_rank: Super Contributor
timestamp: May 11, 2025, 09:12:57 pm
content: Quote from: SiliconWizard on May 11, 2025, 06:03:31 pmthe almanac so you know which and where the satellites are without spending minutes downloading it at 25bps ?

author: peter-h
author_rank: Super Contributor
timestamp: May 11, 2025, 10:03:24 pm
content: QuoteCan you get access to that data, for this module?QuoteIt's a good point that you get valid date/time (actually there is no "valid" flag; you just have to do a sanity check for the year being >2024 etc) regardless of the almanac validity.

author: brucehoult
author_rank: Super Contributor
timestamp: May 11, 2025, 11:19:12 pm
content: Quote from: Siwastaja on May 11, 2025, 05:31:59 pmEven using an out of date almanac is going to be a lot faster than none.

author: peter-h
author_rank: Super Contributor
timestamp: May 12, 2025, 07:19:00 am
content: OK; I can see there are commands for reading out the almanac, etc.

author: WatchfulEye
author_rank: Regular Contributor
timestamp: May 23, 2025, 12:16:52 pm
content: The alamanc was useful in the past, when receivers had few parallel channels, and each channel had limited computational power. In order to decode the signal from a particular SV, the receiver must be able to lock the Doppler shifted frequency and code phase of each signal. From a cold start, that required using a DSP correlator on each channel to search the required parameter space (SV code, Doppler shift, Code phase).In the days of limited parallel channels and weak DSP, this search could be excessively long, hence the alamanc provided coarse bounds which could be used to limit the search space at warm start.These days GPS receivers have enough channels that they can receive all satellites simultaneoulsy, and enough correlator cores to simply brute force search the entire parameter space in a few seconds, hence no meaningful difference in performance between a true "cold" start (invalid almanac) and a "warm" start (valid almanac, but no valid ephemeris).

author: peter-h
author_rank: Super Contributor
timestamp: May 23, 2025, 01:29:07 pm
content: Thanks - that explains a lot.