time-nuts@lists.febo.com

Discussion of precise time and frequency measurement

View all threads

1PPS to 32.768 khz

JH
Jim Harman
Fri, Oct 21, 2016 5:42 PM

On Thu, Oct 20, 2016 at 7:08 AM, Bob Camp kb8tq@n1k.org wrote:

One problem with a PLL and a 1 Hz input are the values of components
you get in the loop.
The other issue is the cost of the VCXO that will get
you to 32,768 KHz.

As I mentioned earlier, the DS3231 chip (about $6.50 qty 1 or $17.50 on a
breakout board) might be a reasonable approach for this. It is a
self-contained 32.768 KHz TCXO that lets you vary the frequency in steps of
0.1 ppm using its I2C interface. Left to its own devices, it measures the
ambient temperature and switches its on-chip capacitors in and out to
control its frequency.

It has both 1 PPS and 32,768 Hz outputs. Connected to an Arduino-class
processor, you could measure the time delay between its PPS and the PPS
from a GPS and tweak the oscillator accordingly, making a complete 32.768
KHz GPSDO including the GPS with just 3 chips.

And you get RTC functionality and battery backup circuitry thrown in for
free.

--

--Jim Harman

On Thu, Oct 20, 2016 at 7:08 AM, Bob Camp <kb8tq@n1k.org> wrote: > One problem with a PLL and a 1 Hz input are the values of components > you get in the loop. > The other issue is the cost of the VCXO that will get > you to 32,768 KHz. > As I mentioned earlier, the DS3231 chip (about $6.50 qty 1 or $17.50 on a breakout board) might be a reasonable approach for this. It is a self-contained 32.768 KHz TCXO that lets you vary the frequency in steps of 0.1 ppm using its I2C interface. Left to its own devices, it measures the ambient temperature and switches its on-chip capacitors in and out to control its frequency. It has both 1 PPS and 32,768 Hz outputs. Connected to an Arduino-class processor, you could measure the time delay between its PPS and the PPS from a GPS and tweak the oscillator accordingly, making a complete 32.768 KHz GPSDO including the GPS with just 3 chips. And you get RTC functionality and battery backup circuitry thrown in for free. -- --Jim Harman
EB
ed breya
Fri, Oct 21, 2016 5:48 PM

I'm kind of late to the party on this one, but I think the simplest
approach with the least disturbance to the operation of the original
system would be to form a VCXO and PLL.

Good old 4000 series CMOS stuff should be plenty fast enough. Two pieces
should be sufficient. For example, a CMOS 4060 counter/oscillator plus a
32,768 Hz resonator, rigged as a VCXO could make the clock, and also
divide it down to a convenient range for 1 PPS comparison. A 4046 PLL or
some simple logic could then do the comparison and make the correction
voltage to the oscillator.

Another option may be to use the clock chip's own system to get a
comparison frequency, if there is a definite and fixed relationship to
some output signal, say a digit scan line, or punctuation (colons
between HMS) flash signal. It's conceivable to then use the chip's XO,
modified to make it voltage-tuned, along with some form of phase
detector logic.

This could be very simple to implement, but would take some figuring
out, and risks hurting the clock chip if you screw up while
experimenting - a definite disturbance. So, it's probably best to use an
external circuit for all.

Ed

I'm kind of late to the party on this one, but I think the simplest approach with the least disturbance to the operation of the original system would be to form a VCXO and PLL. Good old 4000 series CMOS stuff should be plenty fast enough. Two pieces should be sufficient. For example, a CMOS 4060 counter/oscillator plus a 32,768 Hz resonator, rigged as a VCXO could make the clock, and also divide it down to a convenient range for 1 PPS comparison. A 4046 PLL or some simple logic could then do the comparison and make the correction voltage to the oscillator. Another option may be to use the clock chip's own system to get a comparison frequency, if there is a definite and fixed relationship to some output signal, say a digit scan line, or punctuation (colons between HMS) flash signal. It's conceivable to then use the chip's XO, modified to make it voltage-tuned, along with some form of phase detector logic. This could be very simple to implement, but would take some figuring out, and risks hurting the clock chip if you screw up while experimenting - a definite disturbance. So, it's probably best to use an external circuit for all. Ed
TV
Tom Van Baak
Fri, Oct 21, 2016 7:59 PM

Hi Jim,

I'm glad you mentioned the DS3231 aging trick. Many PIC's also have the ability to digitally tune their internal low power oscillator. Attached is a plot showing the 32 steps of the OSCTUNE register in a $1 8-pin PIC12F683.

Notice in the plot that the frequency adjustment range (and step size) of the PIC tuning is very large (+/- 10% fs) compared to the DS3231 (0.1ppm/lsb). This is both good and bad, depending on your application.

One trick that I've used is to apply PWM to the 7-bit OSCTUNE register. Although most people set the value once and forget it, there's no rule that says you can't update the register periodically, even rapidly. So for improved frequency resolution I update OSCTUNE every millisecond (!) as one would with PWM.

Using 1% PWM resolution, the 32 coarse OSCTUNE steps now turn into 3200 fine frequency tunings. With additional effort a GPS/1PPS pin capture directs the step size/direction and you can thus eliminate both the DS3231 and the Arduino. It's my $1 "best worst GPSDO" project. For you PIC assembly programmers the frequency microstep test code is at http://leapsecond.com/pic/src/pg41.asm

The key realization is that many microcontrollers now have internal oscillators, programmable oscillator tuning, and pulse capture capability. So they can function as a crude 1-chip GPSDO. Still, from a practical standpoint, the two chip DS3231 + PIC/AVR/Arduino is a more robust and stable solution, especially in the case where the goal is 32 kHz output.

/tvb

----- Original Message -----
From: "Jim Harman" j99harman@gmail.com
To: "Discussion of precise time and frequency measurement" time-nuts@febo.com
Sent: Friday, October 21, 2016 10:42 AM
Subject: Re: [time-nuts] 1PPS to 32.768 khz

On Thu, Oct 20, 2016 at 7:08 AM, Bob Camp kb8tq@n1k.org wrote:

One problem with a PLL and a 1 Hz input are the values of components
you get in the loop.
The other issue is the cost of the VCXO that will get
you to 32,768 KHz.

As I mentioned earlier, the DS3231 chip (about $6.50 qty 1 or $17.50 on a
breakout board) might be a reasonable approach for this. It is a
self-contained 32.768 KHz TCXO that lets you vary the frequency in steps of
0.1 ppm using its I2C interface. Left to its own devices, it measures the
ambient temperature and switches its on-chip capacitors in and out to
control its frequency.

It has both 1 PPS and 32,768 Hz outputs. Connected to an Arduino-class
processor, you could measure the time delay between its PPS and the PPS
from a GPS and tweak the oscillator accordingly, making a complete 32.768
KHz GPSDO including the GPS with just 3 chips.

And you get RTC functionality and battery backup circuitry thrown in for
free.

--

--Jim Harman

Hi Jim, I'm glad you mentioned the DS3231 aging trick. Many PIC's also have the ability to digitally tune their internal low power oscillator. Attached is a plot showing the 32 steps of the OSCTUNE register in a $1 8-pin PIC12F683. Notice in the plot that the frequency adjustment range (and step size) of the PIC tuning is very large (+/- 10% fs) compared to the DS3231 (0.1ppm/lsb). This is both good and bad, depending on your application. One trick that I've used is to apply PWM to the 7-bit OSCTUNE register. Although most people set the value once and forget it, there's no rule that says you can't update the register periodically, even rapidly. So for improved frequency resolution I update OSCTUNE every millisecond (!) as one would with PWM. Using 1% PWM resolution, the 32 coarse OSCTUNE steps now turn into 3200 fine frequency tunings. With additional effort a GPS/1PPS pin capture directs the step size/direction and you can thus eliminate both the DS3231 and the Arduino. It's my $1 "best worst GPSDO" project. For you PIC assembly programmers the frequency microstep test code is at http://leapsecond.com/pic/src/pg41.asm The key realization is that many microcontrollers now have internal oscillators, programmable oscillator tuning, and pulse capture capability. So they can function as a crude 1-chip GPSDO. Still, from a practical standpoint, the two chip DS3231 + PIC/AVR/Arduino is a more robust and stable solution, especially in the case where the goal is 32 kHz output. /tvb ----- Original Message ----- From: "Jim Harman" <j99harman@gmail.com> To: "Discussion of precise time and frequency measurement" <time-nuts@febo.com> Sent: Friday, October 21, 2016 10:42 AM Subject: Re: [time-nuts] 1PPS to 32.768 khz > On Thu, Oct 20, 2016 at 7:08 AM, Bob Camp <kb8tq@n1k.org> wrote: > >> One problem with a PLL and a 1 Hz input are the values of components >> you get in the loop. >> The other issue is the cost of the VCXO that will get >> you to 32,768 KHz. >> > > As I mentioned earlier, the DS3231 chip (about $6.50 qty 1 or $17.50 on a > breakout board) might be a reasonable approach for this. It is a > self-contained 32.768 KHz TCXO that lets you vary the frequency in steps of > 0.1 ppm using its I2C interface. Left to its own devices, it measures the > ambient temperature and switches its on-chip capacitors in and out to > control its frequency. > > It has both 1 PPS and 32,768 Hz outputs. Connected to an Arduino-class > processor, you could measure the time delay between its PPS and the PPS > from a GPS and tweak the oscillator accordingly, making a complete 32.768 > KHz GPSDO including the GPS with just 3 chips. > > And you get RTC functionality and battery backup circuitry thrown in for > free. > > > -- > > --Jim Harman