cancel
Showing results for 
Search instead for 
Did you mean: 

Sincronize stm32 clock with GPS?

10408892
Associate
Posted on February 25, 2011 at 14:38

Sincronize stm32 clock with GPS?

1 REPLY 1
Posted on May 17, 2011 at 14:25

I think the word you're looking for is synchronize.

But I'm not sure which clock you're looking to do that with, and to what accuracy. You'll need to define your question more precisely.

It's certainly possible to get micro-second or so transfer using interrupts, sub micro-second if you code carefully. The bigger problem is the granularity of the RTC clock ticks, nominally 1 second. Which you can get sub-second if you pick a suitable divisor/prescaler, but still pretty course by most terms.

You can measure/calibrate the HSI, HSE, LSI, LSE clocks, and compute their bias/drift relative to the GPS source, but your question leads me to believe you don't have any mechanism to steer or discipline them. The 40 KHz, and 8 MHz internal RC aren't all that stable in my honest opinion, and without a TCXO providing your primary frequency you're ability to hold-over in the absence of GPS isn't going to be terribly good.

You could certainly measure the 1PPS period over some divided down version of the APB clocks, but the resolution will be somewhat degraded because you only have 16-bits to work with.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..