But, I am diverted to yet another project, to build an even more accurate Frequency Source for the Propeller Master Clock. The TCVCXO that I built using the Homebrew circuit board has been doing very well in all experiments. It occurred to me that if it was connected to a GPS one second tick, it could be steered to even more accuracy.
So far, only initial plans are in place, with some circuit diagrams and example code.
The strategy is to implement a Huff-n-Puff circuit and support Propeller SPIN code to "drive" the Voltage Control Pin with corrections - Results: A GPS Disciplined Frequency Master Clock.
Google: Huff-n-Puff Oscillators
Actually, this is all experimental, and I do not really know what to expect. But, this is what I have at present.
https://www.circuitlab.com/circuit/8bt74u/prop-tcvcxo-huffnpuff/ |
The following is a code snippet from my current GPS ISR Object (has not been tested).
PRI Huff_n_Puff | C, PrevC
PrevC := 0
Trend := 0
dira[GPSPin]~ ' Set for Input, and Float high via Pullup 10K Resistors
repeat
Trend #>= 10
Trend <#= -10
pause(80 * ||Trend) 'Pause should be less than ~900ms
dira[HnPPin]~ 'Set Tri-state Mode
waitpeq(0, 1<<GPSPin, 0) 'waiting for CPS SEC Pin to be LOW
waitpne(0, 1<<GPSPin, 0) 'waiting for CPS SEC Pin to go HIGH
C := cnt
CountError := C - PrevC - CLKFREQ
PrevC := C 'Save for next iteration
if(CountError > DEAD_BAND)
Trend #>= 0
Trend--
IF( HnPEnabled)
HnPStat--
outa[HnPPin]~ 'Huff - Make Pin LOW
dira[HnPPin]~~ 'Output Mode
elseif(CountError < -DEAD_BAND)
Trend <#= 0
Trend++
IF( HnPEnabled)
HnPStat++
outa[HnPPin]~~ 'Puff - Make Pin HIGH
dira[HnPPin]~~ 'Output Mode
else
Trend := 0
The intent is to "drive" the Voltage Control Oscillator (TCVCXO) to match the GPS. The RC time constant of the Huff-n-Puff circuit above, along with the Program logic should only gently correct the output Frequency.
What I expect for output is a square wave (at HnPPin), varying duty cycle depending on correction needed.
Obviously, more development and testing is needed.
Please comment, if you have experience with this sort of thing.
UPDATE
I found the following interesting page: http://www.rt66.com/~shera/index_fs.htm
--