Close

Sawtooth correction

A project log for GPS Disciplined xCXO

A DIY GPS disciplined 10 MHz reference clock

nick-sayerNick Sayer 08/22/2016 at 16:020 Comments

I've got back the prototype boards for the version of the OCXO variant with the ATMega328p and the SkyTraq module. I've been able to achieve sawtooth correction with the firmware:

The blue line is the raw phase detection value and the red line is the post-correction value. It turns out that you have to scale up the sawtooth correction value given by the module 1.5x to apply it to the phase ADC values. There's a constant in the firmware code that represents the scaling factor, should that need to be tuned going forward. It's not completely clear why the scaling is so large.

Because the ATMega328p lacks a 4.096v ADC reference, I went with the 1.1v one. That allows for a more linear phase discriminator response (even if it may be slightly noisier). For that to work, the charging resistor changed to 3kΩ and the cap to 1000pF. The nominal time constant of that is 3µs, which seems way too long, but when you look at it on the scope, it's a little bit higher than 1.1v when the phase is off by the maximum value of nearly 1µs. What that should mean is that each ADC count should be very close to a nanosecond, since there are 1024 counts. Instead, if the scale factor is to be believed, it's more like 666 ps. Either way, it does seem to work.

Discussions