S
S
Sergey Kordubin2019-05-10 06:39:32
C++ / C#
Sergey Kordubin, 2019-05-10 06:39:32

How to get exact synchronous time in milliseconds on multiple devices from rtc?

Good afternoon.
Based on stm32f446ret6, I'm trying to implement an application using MBED-OS 5.
I recognize esp8266 from hards every 400ms, exchange via http1.0 within 320ms. This is controlled by the thread.
The second thread is busy outputting to lcd0802.
There are three buttons start, stop, on / off.
It is required that the timer can be synchronized, and know the time to milliseconds. That is, if the start value comes to the timer so much, then the timer starts counting, when you press the stop button, the timer simply in the transmission says the time the button was pressed.
Problem such, RTC return time in seconds. And they walk pretty well.
The timer floats terribly in 10 minutes one milliseconds.
So far implemented like this:
I started an interrupt on the ticker, the ticker restarts the timer, as a result, for some reason, the RTC floated.
In general, please, who knows mbed os,
Help with advice. How to correctly
Receive and synchronize rtc time in mbed-os with an accuracy of up to ms.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
res2001, 2019-05-10
@res2001

Since we are talking about network devices, then you probably need an NTP implementation for your device and OS. Look at RFC 5905, maybe you will find something ready-made or implement it yourself. Actually, it is possible that only the transport part will have to be implemented, because logic can be taken from existing software.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question