Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:17 13 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : GPS on the F4

Author Message
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1106
Posted: 11:52am 23 Jul 2019
Copy link to clipboard 
Print this post

I got a GPS module (CAT.NO: XC3712 from Jaycar) connected to my F4. Works well.

However, I had noticed that occasionally, the time was about 3 sec fast but then came good so I wasn't too concerned.

I had it totally off today & when I switched it back on & it gave the all clear as far as the GPS was concerned, it was definitely 3 seconds or so fast (4 satellites). It came good about 10 minutes later with a few more sats detected (8-9).

I switched it off again for about an hour & when I turned it back on, it came up showing the supposedly correct time (from the RTC) but when the GPS all clear came, it jumped 3 seconds. (TIME$ is set to GPS(TIME) when GPS OK))

I then waited & about 7 minutes later, it reverted back to the correct time.

I suspect that there is something astray in the GPS module.

I may do some more playing around to see if I can find any other clues.

I did not think to get if the Lats & Logs were OK or not.

Brian
ChopperP
 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 330
Posted: 06:05pm 23 Jul 2019
Copy link to clipboard 
Print this post

A couple of years ago I purchased two VK2828U7G5LF Ublox GPS modules from Banggood. I put together a pair of identical clocks. One I use to write and test the clock code and hardware and the other is my bedroom clock. Last month is the first time I ever had both clocks together in the same room. When I powered up the development clock, it was 2-3 seconds off. I left the room for a few minutes and when I returned both clocks were in perfect sync. I cycled the power on the development clock and it came backup in sync. When I left it unplugged for a couple of hours then powered it up again it was out of sync again and a few minutes later it was back in sync.

At first I thought the problem was in my code. In an attempt to make the displayed time as accurate as possible, I read the GPS data, extract the UTC time and date, add 1 second, adjust the time date accordingly, convert to local time then adjust for DST if needed. The time is then displayed when data for the next GPS update starts. Lots of places for things to go wrong, but both clocks use the same hardware and software.

In the end, I figured the GPS module must need to more satellites to read in order to reduce the discrepancies caused by the satellite orbits. I blame it all Einstein and his crazy theory of relativity. Obviously my hardware and code is perfect.

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 2006
Posted: 08:58pm 24 Jul 2019
Copy link to clipboard 
Print this post

Have a look HERE
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1106
Posted: 09:27pm 24 Jul 2019
Copy link to clipboard 
Print this post

Thanks for that.
ChopperP
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1106
Posted: 08:00am 25 Jul 2019
Copy link to clipboard 
Print this post

@palcal. So from what I can gather after more searching is that the GPS time does not include leap seconds but sends a correction for UTC every 12.5 minutes.

Anyway, the solution is to wait at least 12.5 minutes after switch on before valid time can be assured.

@justplayin. Thanks for the reply. Sort of glad you had problems as well.
At present, I look out for the change between the 6th & 7th second (every 10 sec), then have a 500mS pause, then add 1 sec & reset TIME$ on that so I am ~1/2 a sec fast during normal operation to sort of account for delays in my system. (resetting my CMM at midnight)

Now I am even more confused. A bit more reading suggests that GPS time is about 11-12 even up to seconds 19 ahead of UTC. So I don't know where the 3 secs comes from.

My understanding of Leap Second was not correct as well. 1 second gets added to UTC every so often which means that UTC slows down by 1 second compared with GPS time. For some reason, I thought it sped it up.

More info

My brain hurts!!!
ChopperP
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025