MKR1010 Wifi clock drift | NTP | DS3231

Hello everyone, I need your precious help.

The project consists of 3 mkr1010 wifi modules (each one of them connected to an w5500 network controller to have ethernet).

The 3 modules connect via ethernet to a gateway where they retrieve NTP synchronization.

One of them (master) generates a 62,5hz clock signal (shared between the 3 modules) so that all 3 can read the sensors simultaneously. The interval between sensor samples is 16ms and each reading is associated with a timestamp in milliseconds, which is sent in a packet to the server.

Every minute a synchronization is made with gateway NTP, because there is a lot of drift in millis() in a minute in MKR1010.

I'm using @MartinL suggestion https://forum.arduino.cc/t/arduino-zero-clock-drift/962861/21 using a DS3231 to feed the MKR clock.

But, I keep getting differences between the local timestamp and when NTP occurs, and I can“t get the D2 to output 1MHz like MartinL said. I'm afraid that the example he gave doesn't apply to the mkr1010 wifi.

Therefore, I need the 3 modules to read the sensors synchronously and for both to have the same timestamp, with an error of up to 3ms at most.

If anyone has already done something similar and can share their knowledge, I would appreciate it.

Thank you all in advance for your help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.