The MCU used is a STM32F042 which is clocked by an OCXO oscillator (Abracon 10 MHz - 20 ppb). The subject of this thread is to get the best accuracy on one PPS Timer. For my application, I need to synchronize my MCU outdoors on the GPS PPS and then go indoors without any GPS Signals and keep my accurate PPS Signal.
I have a timer to get an interrupt every seconds. This interrupt has to be as close as possible to the GPS PPS. This GPS PPS is received on an interrupt pin which launch this process.
I synchronize my timer on the PPS reception but after one hour, my interrupt has drifted from 5 ms.
To get this result, here is the settings of the selected timer:
When I try the formula from ST which is: F timer = F clock / ( 1 + Prescaler ) * (1 + Period) with the following values : Prescaler = 199 and Period = 49999, the result is worst.
Anyone could help me? Thanks