[ntp:questions] Making ntpd tweak a TCXO

A C agcarver+ntp at acarver.net
Thu Jan 28 01:30:46 UTC 2016

If this is a TCXO that uses the voltage input as a trim (otherwise
internally regulating the temperature on its own) then you may actually
be better off using a D-to-A converter (something like 16-bit
resolution) than PWM on the input.  The result will be more stable
(jitter in the trim signal will translate to jitter in your oscillator
output and the PWM from many general purpose microcontrollers is not
very stable for this kind of application, it's more aligned towards
running servo motors)

On 2016-01-27 08:55, Mark Haun wrote:
> I have an embedded system (Beaglebone Black) with an external 14.4-MHz TCXO. 
> I am going to write a clock-source driver to use this oscillator as the
> system clock source in Linux.  The TCXO has a voltage-control input which
> can be adjusted with a PWM output from the Beaglebone.
> My application (amateur seismometer data acquisition) does not require great
> accuracy, but I would like the data stream from my A/D to be long-term
> accurate.  That is, if the sampling rate is 60 Hz, I would like 60*86400*365
> +/- 1 samples in a [non leap] year.  This should be fairly easy with NTP if
> the typical accuracy is in the 10s of milliseconds.  Short-term variations
> of a few ppm (the TCXO stability) are no problem.
> To that end, I'd like to discipline the TCXO using ntpd.  I would like it to
> *not* change the virtual clock frequency in software as it usually does, via
> adjtime or whatever hooks are provided by the OS.  Instead, I want the
> frequency corrections to go through my own driver to adjust the hardware
> oscillator directly.
> Does the NTP software provide any hooks that could be used to accomplish
> this?  I thought of a crude approach, simply writing a program to examine
> the drift file periodically, and using that information to adjust the TCXO. 
> But that (a) fails to stop ntpd from adjusting the virtual clock frequency
> within the OS, and (b) isn't really a proper control loop.  I guess it would
> work, sort of, as a last resort.
> Is it feasible to hack the time-adjustment interface on the Linux side of
> things, so ntpd doesn't know the difference?  I believe there is an option
> to make NTP do frequency corrections only, not time steps.  I would need
> that.
> Any suggestions?
> Thanks,
> Mark
> _______________________________________________
> questions mailing list
> questions at lists.ntp.org
> http://lists.ntp.org/listinfo/questions

More information about the questions mailing list