in a loop for example:..// sampling the two signals (RTC secs and millis)rtc_sec = t.sec; // I get RTC's seconds 0..59mil_sec = millis(); // I get millis// I am trying to measure the diff as: rtc_sec%10 - mil_sec%10000/1000, so the "window" is 10 secs// I do filtering here - exponential moving average (EMA), because the diff jumps up and downaver_dt = ( ( (float)(rtc_sec%10) - ( (float)(mil_sec%10000) / 1000.0) ) * 0.005 ) + (aver_dt * 0.995);
The phase difference will depend on the time of day that the Arduino was started..
What I would do is connect the 1 PPS signal from your RTC to an interrupt pin
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16