5 years, 3 months ago.

Synchronisation

How to synchronise mbed clock with another clock?

That depends on which clock source you wish to synchronize with, NTP (internet), Radio clocks that use LF receivers such as DCF77 (German) MSF (British). Need a bit more information to help further.

posted by Paul Staron 25 Jan 2019

I have a gps module which gives pulse per second need to calibrate the 48mhz clock of mbed with it

posted by aman chawla 25 Jan 2019

2 Answers

5 years, 3 months ago.

Hello, Aman

After receiving a newTime from another clock over a communication channel (like UART, SPI, I2c, Ethernet etc.) as soon as possible call:

set_time(newTime);

NOTE: newTime shall be declared as:

time_t newTime;  // number of seconds elapsed since 00:00, January 1, 1970

5 years, 3 months ago.

Okay, the one pulse per second output from the GPS module will not stable enough, to do that you will need to use that pulse to control an OVXO (oven voltage controlled oscillator). But there is something here that may be relevant for you:

https://electronics.stackexchange.com/questions/317035/disciplined-oscillator-using-countermicro

Although this wont be very stable it may help for what you are trying to do otherwise this information may help:

http://www.jrmiller.demon.co.uk/projects/ministd/frqstd0.htm

I made a version of this using a Neo 6 GPS module that can be set to give 10kHz output rather than 1Hz this results in a faster locking/stabilizing time. I used a LPC1114FN28 MCU to control the process and drive a colour LCD. The stability checked out at around 6x10-12 . (+- 0.000,000,000,006Hz)