Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sntp: calibrate to the ntp times rather than the system function. #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

sntp: calibrate to the ntp times rather than the system function. #157

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 1, 2016

WIP, not for merge yet.

The system sdk_system_rtc_clock_cali_proc() is rather noisy, so this patch calibrates the RTC count to the NTP time responses.

An average of many calls to sdk_system_rtc_clock_cali_proc() is used for initialization.

The system calibration value is used to limit the calibration value computed via the ntp times, to 1/16 either way.

A 64 bit RTC counter is implemented, and used in the calculations, but might be of some use on its own.

The ratio of the ntp time differences and the RTC count differences is filtered a little to keep the changes relatively stable and to filter the jitter.

The system sdk_system_rtc_clock_cali_proc() is rather noisy, so
this patch calibrates the RTC count to the NTP time responses.

An average of many calls to sdk_system_rtc_clock_cali_proc() is used
for initialization.

The system calibration value is used to limit the calibration value
computed via the ntp times, to 1/16 either way.

A 64 bit RTC counter is implemented, and used in the calculations, but
might be of some use on its own.

The ratio of the ntp time differences and the RTC count differences is
filtered a little to keep the changes relatively stable and to filter
the jitter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant