# Synchronize RTC of 2 different MCU's [closed]

I have 2 different microcontrollers and I need to use their internal RTC. however I need the 2 RTC's to be in sync when they are used. How would I achieve something like this?

## closed as too broad by PeterJ, Nick Alexeev♦, Daniel Grillo, Chetan Bhargava, Matt YoungMar 8 '14 at 20:49

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• How are they connected together and what type of MCUs are they? Do you have external time sources available like GPS or Internet time servers etc? – PeterJ Mar 8 '14 at 12:53
• How closely synchronised? would a femtosecond difference cause a catastrophe? – RedGrittyBrick Mar 8 '14 at 17:51
• About a couple of microseconds – Developer Android Mar 9 '14 at 5:48

For distributed system, the common solution is using a GPS disciplined clock. There are many embedded GPS receiver modules from different companies which provide timing information and a 1 PPS signal. A module built specifically for timing usually includes an OCXO for stability. One such module is the Trimble Thunderbolt (\$). It all depends on the timing precision you require, few milliseconds will be cheap, few microseconds will be expansive. Also, if you have an Ethernet connection, IEEE 1588 (PPTP) is worth a consideration.

If you have some form of data communication channel between the two MCUs then one can report to the other what the time is and if the error is small do nothing else make an adjustment.

Alternatively you can use IRIG. From the link: -

Inter-range instrumentation group time codes, commonly known as IRIG timecodes, are standard formats for transferring timing information. Atomic frequency standards and GPS receivers designed for precision timing are often equipped with an IRIG output. The standards were created by the TeleCommunications Working Group of the U.S. military's Inter-Range Instrumentation Group (IRIG), the standards body of the Range Commanders Council. Work on these standards started in October 1956, and the original standards were accepted in 1960.