This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Nordic Clock Drift with Internal LFCLK when trying to synchronize with an external client or another Nordic clock (Nordic -nRF52840)

Hello,

I am using a nRF52840 with SDK 14.2 and I am trying to synchronize my "app timer" which uses the RTC1 with respect to an external client which is connected over TCP protocol.

Hardware Setup: nRF52840 is connected to a Wi-FI module over UART and the TCP connection is established between the Wi-Fi module(Server) and a client program on a PC.

I send a command to the Nordic from client to start the timer, also start a timer at the same time on the client.
When I receive a packet(with the timestamp in mS) at the client side, I compare the timestamps of Nordic and MAC client and expect the difference= (time_at_client - time_from_nordic) to be positive but it's negative and grows very large every second.
I am assuming it's because of the clock drift on the nRF52840. I want to solve this issue as I want to synchronize time between nRF52840 - Client and also synchronize between 2 nRF52840 modules eventually.

Anyone faced this issue before and know of any software solution?

Thanks in advance,
Akhil

Notes:
1) Tried comparing TICKS and converted mS. See this issue with both values.
2) All calculations are taken care of.
3) I understand that external Crystal could increase accuracy and help in this scenario but there's a hardware limitation.

Related