Toyo TCO-919 "High Stability" crystal oscillators - Page 1
Forum section: electronics / projects

author: dannyf
author_rank: Super Contributor
timestamp: June 19, 2014, 12:10:22 pm
content: Got some of those from a friend and will think about what to do with them.They seem to be some sort of sonet oscillators (19.44Mhz). The datasheet I could find suggests that they are 2.5ppm oscillators powered from 5v (only 2ma current consumption).The ones I have are VCXOs - there is another version that allows modulation by audio. Oddly enough, the datasheet doesn't say that those are TCXOs but from the spec they must have some ways of temperature compensation.Will post pictures later.

author: dannyf
author_rank: Super Contributor
timestamp: June 27, 2014, 09:14:55 pm
content: Sorry for the delay in posting the pictures, as promised.Here are some pictures of the Toyo oscillator.The devices that I got are TCO-919R3. The datasheet I could find is for TCO-919R (the A version is for audio modulation, and the R version looks to be a typical VCXO, with pin 1 being the control pin).The only difference I could find is the drive levels: the R version is minimum 1Vpp. The R3 version is more like 50mVpp.The adjustment range is about 200 - 300hz (10ppm, which is consistent with the datasheet).

author: dannyf
author_rank: Super Contributor
timestamp: June 27, 2014, 09:19:54 pm
content: 50mVpp wouldn't be sufficient to drive most digital devices. To increase the drive levels, and to lessen the loading on the oscillator, I used a HC00 (happen to have a few handy).I configured the first gate as a linear amplifier, with a resistor from its output to its input (which is AC coupled to the TCO919's output). The amplifier's output then drives the 2nd gate to get a digital output.The swing, for the particular HC00 I have, is just shy of 3Vpp (3.3V rail).The oscillator takes about 15 - 20 seconds to warm up. After that, it is rock solid.Here is a picture of it being measured on the minimalist frequency meter I wrote a while back - runs on a PIC16F1936 hidden underneath the LED display.

author: dannyf
author_rank: Super Contributor
timestamp: June 27, 2014, 09:22:20 pm
content: Layout: the oscillator takes the typical dip14 layout. Looking from the top, pin 1 (lower left) is the control voltage (floating is OK); pin 2 (lower right) is ground; pin 3 (upper right) is the output pin (sine wave of 19.4400Mhz), and pin 4 (upper left) is Vcc (5v specified but works just fine at 3.3v).

author: dannyf
author_rank: Super Contributor
timestamp: June 27, 2014, 09:25:43 pm
content: Operating current: the datasheet says 2ma max but I measured to be 0.5ma @ 3.3v and 1.2ma @ 5v.Not bad.

author: dannyf
author_rank: Super Contributor
timestamp: June 28, 2014, 10:38:27 am
content: I changed the code a little bit to use the TCO-919R as the external oscillator.Here the meter is measuring its own frequency - 19.44Mhz.

author: dannyf
author_rank: Super Contributor
timestamp: June 28, 2014, 10:41:37 am
content: Here, the meter is measuring the frequency of a 16.128Mhz TCXO. It shows 16.13Mhz on the meter due to the rounding.The red arrow is where the clock signal from the external oscillator (TCO-919) comes in; The green arrow is where the 16.128Mhz signal comes in.

author: dannyf
author_rank: Super Contributor
timestamp: July 05, 2014, 03:29:51 pm
content: I set up two TCO-919Rs to compare their relative frequency stability.See the picture for the set-up.The TCO-919R on the top right is acting like the oscillator to a minimalist frequency meter (PIC16F1936, underneath that 4-digit LED display. Shown in a separate thread). It shows 8-digit frequency read-out, 4 digits at a time.The TCO-919R on the top left is acting like an external pulse train to be counted by the frequency meter. Pin 1 of the TCO-919 (bottom left pin) is the voltage input that controls the output frequency. By adjusting the voltage on Pin 1, I had a reading of 19,440,000 on the frequency meter.When I did it yesterday, it was about 80F. This morning, it was about 60F. The reading barely changed, mostly at 19,440,000Hz and once in a while it will turn to 19,440,001Hz.Those oscillators are really tracking each other very well, with little / no meaningful drifting.

author: dannyf
author_rank: Super Contributor
timestamp: July 05, 2014, 10:57:30 pm
content: The short-term goal of the exercise is to see if I can build a high stability, GPS-trained arbitrary frequency generator.The basic concept is to use a mcu to generate a control voltage that changes the TCO-919's output frequency. The mcu's output can be trained by a 1pps source (aka a GPS receiver for example, or a OCXO divided down). In addition, the mcu performs two tasks:1) it tracks the TCO-919's output frequency to make sure that it stays on the target frequency by measuring and altering the TCO's output frequency;2) the mcu also controls a programmable PLL clock generator (CDCE913 for example) that will take the output from the TCO and multiply it to a user specified frequency.

author: dannyf
author_rank: Super Contributor
timestamp: July 05, 2014, 11:01:26 pm
content: So far, I have been able to use the mcu to produce an analog voltage output and generate a full-range (0-3.3v) Vcontrol on the TCO. The output frequencies I got is from 19,439,989Hz to 19,440,208Hz. That represents a delta of 11ppm, vs. +/-5ppm from the datasheet.The next phase would be to build a frequency meter so that this mcu could read the TCO's output frequency - fairly easy.

author: dannyf
author_rank: Super Contributor
timestamp: July 06, 2014, 01:23:47 pm
content: Almost there.Here is a picture of the TCO running at 19,440,070Hz under the control of a mcu.The controlling mcu is on the left, under the 4-digit led display. It takes a 1pps input from the mcu/frequency meter on the right.The controlling mcu also takes in the output from the upper left TCO (its frequency is also being measured and displayed on the right.This particular picture shows that 1) the TCO is outputing a 19,440,070Hz signal (only its lowest 4 digits are displayed), and 2) the pwm output from the controlling mcu is 356, which under 3.3Vcc and 10-bit pwm, means a control voltage of 3.3*356/1024 = 1.14v vs. actual measurement of 0.94v.At the time the picture was taken, I used a gain (duty cycle per hz of frequency error) of 4x. I have found that at that gain setting, the reading fluctuates from 19,440,070 and 19,440,069. I tried a gain of 1x and that takes some time (like 10 - 15 seconds) to stablize. So I settled on a gain of 2x. as a good compromise between stability and speed.Once we use a 1pps signal from a high stability source, like a gps, we are in business.

author: dannyf
author_rank: Super Contributor
timestamp: July 31, 2014, 10:16:16 pm
content: Behaviors:1) when the code first boot up on a chip, it checks to see if it has been previously programmed with the code. If it is, it retrieves the user-specified parameters and then runs with it.2) if it is the first time that the code is running on the chip, it will save its default parameters onto the chip and then runs from there.3) aside from specifying the parameters (to be discussed), there is no other user adjustments.The 1pps signal as a typical on-state of 1us (it varies with the frequency of the external clock, F_OSC).Here is the 1pps signal when running on the Toyo 919R (19.44Mhz 2.5ppm TCXO).

author: dannyf
author_rank: Super Contributor
timestamp: July 31, 2014, 10:34:04 pm
content: User customization:The code requires three user-specified parameters to run, saved in eeprom:1) F_OSC (eeprom address 0 - 4): this is the frequency / 4 of external oscillator. For Toyo 919, the number should be 19.44Mhz / 4 = 4,860,0000 (or 0x004A2860), the organization in eeprom is as follows:eeprom address 0: 0x46 (ascii 'F');eeprom address 1: 0x60 (LSB of F_OSC / 4);eeprom address 2: 0x28;eeprom address 3: 0x4A;eeprom address 4: 0x00 (MSB of F_OSC / 4).2) half period (in ticks) of OUT_A: this is the period, measured in mcu ticks, you would like OUT_A to be high or low. To achieve a default 1Hz signal with F_OSC of 4.86Mhz, we want this to be 4.86/2 = 2,430,000 or 0x00251430. It is organized in eeprom as follows:eeprom address 5+0: 0x41 (ascii 'A');eeprom address 5+1: 0x30 (LSB);eeprom address 5+2: 0x14;eeprom address 5+3: 0x25;eeprom address 5+4: 0x00 (MSB).3) half period (in ticks) of OUT_B: similarly for default frequency of 10Hz, we want this number to be 4.86Mhz / 20 = 243,000 or 0x0003B538. It is organized in eeprom as follows:eeprom address 10+0: 0x42 (ascii 'B');eeprom address 10+1: 0x38 (LSB);eeprom address 10+2: 0xB5;eeprom address 10+3: 0x03;eeprom address 10+4: 0x00 (MSB).To show you that that's indeed the case, here is the eeprom dump from simulation and I trust that you can find those numbers there,

author: dannyf
author_rank: Super Contributor
timestamp: July 31, 2014, 10:46:24 pm
content: Here is the read back from an actual pic12f675 running the code @ 19.44Mhz.As you can see, the eeprom content matches the simulation.

author: dannyf
author_rank: Super Contributor
timestamp: July 31, 2014, 10:58:14 pm
content: How does one customize the code?Obviously, you may not want to have the same oscillator, or want to output the default frequencies. If so, you need customization. That can be done, as you would have guessed it, via rewriting the eeprom content, specifically those three parameters in eeprom.Let's say that you are running a 10Mhz oscillator and you want OUT_A to flip at 25Hz and OUT_A at 3Hz.1) F_OSC/4: 10Mhz / 4 = 2,500,000 or 0x002625A0;2) OUT_A: 2,500,000 / 2 / 25 = 0x0000C350;3) OUT_B: 2,500,000 / 2 / 3 = 0x00065B9A;So eeprom should be, starting from address 0:46 A0 25 26 00 ='F', 0x002625A041 50 C3 00 00 ='A', 0x0000C35042 9A 5B 06 00 ='B', 0x00065B9AWriting those numbers into the eeprom would allow the code to run on the new parameters.Obviously, following the same script on a different set of assumptions / desired output will yield different numbers.Hope it helps.

author: dannyf
author_rank: Super Contributor
timestamp: July 31, 2014, 10:59:46 pm
content: The PRO version requires an external oscillator (actually it can be also programmed on crystals - not done here).If that's too much and you can tolerate 1% or so precision, you can turn to the STD version that runs on the 4Mhz internal oscillator.I will post the code later.

author: dannyf
author_rank: Super Contributor
timestamp: March 15, 2015, 01:28:09 pm
content: So I decided to put together a quick 1pps generator using the tco oscillator.I started with the usual suspect, PIC12F675, but quickly realized that it is not doable due to the fact that the prescaler would be cleared once you write to the timer counter. The tco oscillator's output is at 19.44Mhz and that's not fully divisible by 256. So if I cannot reload the timer without destroying the prescaler's values, I would have to use an external counter, a complication I didn't want to have.Fortunately, timer2 on the PICs are auto reloading so by moving to PIC16F684, I can get around that.The code is simple:1) use the tco oscillator to drive the PIC's clock;2) use the tmr2 to count instruction cycles;3) use the tmr2 isr to count the number of times the isr has been triggered and use that to generate the 1pps signal.If we set tmr2 to reload at 250, prescaler at 1:16, every second, the isr will fire: (19.44Mhz / 4) / 16 / 250 = 1215 times.The code is very simple: set up the output pins and the timer, and then run an empty loop.

author: dannyf
author_rank: Super Contributor
timestamp: March 15, 2015, 01:40:19 pm
content: Here is this thing living on a breadboard.Only 4 parts are needed: pic16f684, tco-919R @ 19.44Mhz, a 100k-10M resistor, and a 0.1uf decoupling cap.

author: dannyf
author_rank: Super Contributor
timestamp: March 15, 2015, 01:46:15 pm
content: Variations:1) the same concept can be taken to other mcus and other tcxo;2) the particular pic is rated 20Mhz at 5v but runs just fine down to 3v.3) the particular oscillator is rated at 5v but also runs fine down to 3v.4) I didn't implement frequency tuning. Simple and not difficult to do if you wish to.

author: dannyf
author_rank: Super Contributor
timestamp: March 15, 2015, 02:09:41 pm
content: Current consumption @ 5v:TCO: 0.6ma,PIC: 1.6ma,LED: 1.5ma.

author: dannyf
author_rank: Super Contributor
timestamp: March 15, 2015, 03:32:25 pm
content: I happen to have a 50Mhz oscillator handy so I fed it to the PIC, both at 5v and then at 3.3v.The code (written for 19.44Mhz oscillators) worked just fine, blinking obviously much faster.This PIC is runing at 2.5x of its rated clock rate @ 5v, and 5x of its rated clock rate @ 3.3v.

author: dannyf
author_rank: Super Contributor
timestamp: March 15, 2015, 08:25:14 pm
content: Ran the code on a NDK 19.68Mhz vc-tcxo.

author: dannyf
author_rank: Super Contributor
timestamp: March 17, 2015, 08:19:28 pm
content: Once you have the generation of 1pps (or 0.5Hz) signal, you will need to calibrate that signal.A natural solution would be to use a precision oscillator, like a 10Mhz OCXO, go through a divider to get a low frequency 1pps or 0.5Hz reference signal so you can compare your signal against.An OCXO can be expensive and of unknown quality when procured over the ebay.A much better and much simpler solution would be to use a GPS receiver. My favorite is the ublox neo-series. Coupled with u-center, it can generate an output signal of given frequency / duty cycle. Making it perfect for our purposes.

author: dannyf
author_rank: Super Contributor
timestamp: March 17, 2015, 08:21:56 pm
content: One typical way to compare two pulse trains is to watch then on a scope, with the display triggered on one pulse train. If the two pulse trains are not perfectly synchronized, you can observe one pulse train moving left or right on the screen vs. your reference pulse train.Well, that approach works well with a high frequency signal (several Khz or up).As our signals are in the 0.5Hz to 1Hz, and are not guarantted to be timed together, that approach is hard to implement here.

author: dannyf
author_rank: Super Contributor
timestamp: March 17, 2015, 08:47:10 pm
content: Since i am already using pic16f684, I am going to use it to measure the timing difference.The easier solution to detect rising edges would be to use two external interrupt pins. Unfortunately, the PIC16F684 has only one external interrupt pin. So we will use interrupt-on-change for the 2nd pulse train.The outputing the timing difference could be done with a LCD. But I am going to use just a pwm pin through a low-pass filter. By observing the voltage changes on the low-pass filter, I can tell if the two pulse trains are synchronized.

author: dannyf
author_rank: Super Contributor
timestamp: March 20, 2015, 04:39:28 pm
content: Now, some background:the 1pps comparator's output section is set up to output 8-bit pwm (the duty cycle value actually comes from TMR0 - later on that). I am running the comparator on a 4Mhz crystal, so the PWM frequency would be 1Mhz / 256 = 3906Hz - see the picture attached.Because of the 8-bit resolution, and 5v Vcc, each bit of duty cycle corresponds to 5000mv / 256 = 20mv.As the measurement is taken on the rising edges of the 1pps signals, the pwm output is updated every 1 second.So if we see a 20mv change in the output each second, we know that the two signals are 1ppm apart.Sub-1ppm measurement can be done by either observing the changes over a longer period of time, or with a faster clock to the comparator.

author: dannyf
author_rank: Super Contributor
timestamp: March 20, 2015, 04:42:49 pm
content: With no trimmer wired to the TCO, the meter showed a change of <100mv per second. or 5ppm off.With a trimmer, you can adjust the TCO's output to stabilize the analog output from the 1pps comparator - the output levels at which the readings stabilize don't actually matter.For this particular TCO, the output stablized to 2.168v - it fluctuated a little, I assume due to phase noises or jitter.

author: dannyf
author_rank: Super Contributor
timestamp: March 20, 2015, 04:45:08 pm
content: The corresponding Vcontrol on the TCO is 2.405v.So going forward, rather than calibrating an oscillator to a gps, I can simply calibrate them to this particular TCO-919R, with Vcontrol set to 2.405v.

author: dannyf
author_rank: Super Contributor
timestamp: March 20, 2015, 04:50:31 pm
content: Advantages of this approach vs. others:1) as it reduces the oscillator frequencies down to 1pps, you can compare any oscillators the same way, to the extent that the frequencies can be divided down to 1pps.2) high precision: you cannot get much better than a gps in terms of timing precision.3) inexpensive: a gps module cost less than $20, and any simple mcu can be programmed to divided down the frequency and compare two pulse trains.4) ease: minimum parts count.Disadvantage:1) does not easily provide a measurement of timing errors: detecting two pulse trains in sync is easy. You can only estimate how far off they are by observing the rate of output changes. For oscillators that do not have an adjustment pin, this approach is only qualitative, not quantitative.2) slowness: output is updated once every second. So it takes 10 - 20 tries to get two pulse trains aligned.3) the comparator has to run off a clock source with low jitter - an internal rc oscillator would not work here. I used a crystal.

author: dannyf
author_rank: Super Contributor
timestamp: March 20, 2015, 04:58:28 pm
content: Variations:1) as configured, the 1pps comparator can measure up to +/- 128ppm on 1pps pulses. I think it provides a good balance of precision and range. One may argue that that kind of errors far exceeds what a typical crystal oscillator would exhibit (20ppm tops). One way to provide more precision is to run the 1pps comparator faster. If you were to run it at 2Mhz Fcy, you have a range of +/- 64ppm, and at 4Mhz Fcy, you have a range of +/- 32ppm.2) The way the comparator is coded, you can run it on pulse trains up to 1Khz, and likely into a few Khz. That's caused primarily by the lack of a 2nd external interrupt on this particular PIC. As a result, we have to rely on the IOC, so we have to re-read the port in the isr. That means the minimum pulse width would be like 20 - 30 ticks, factoring in the interrupt latency. If you implement this on a PIC with two external interrupt pins, you will be able to compare much faster pulses.

author: dannyf
author_rank: Super Contributor
timestamp: March 20, 2015, 10:54:37 pm
content: I have calibrated three TYCO-919 TCXO and two NDK TCXO.The Vcontrol for the tyco's are 2.405v, 2.416v, and 2.464v; For the NDK, they are 1.926 and 1.760v. The TYCOs have much tighter tolerance, based on a sample of three.Unfortunately, I only have five of those TYCOs,.

author: dannyf
author_rank: Super Contributor
timestamp: March 24, 2015, 02:21:21 pm
content: Just how accurate this approach can in comparing two oscillators?I ran two oscillators over a period of 10 minutes - after they have stabilized.The output of the 1pps comparator drifted from 926mv to 679mv, for a change of 247mv. The comparator is set on 20mv/1us scale. So the pulses drifted 247mv / (20mv / 1us) = 12us. The duration is 10 min * 60sec/min * 1e6us/sec= 0.0205ppm apart.So you can really calibrate it to a very tight tolerance. The downside with this approach is that each adjustment can take a long time, particularly towards the end: you have to wait 5 - 10 minutes after each adjustment to see the drift accumulating sufficiently.

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 08:53:05 am
content: I didn't realize this until last night: the 1pps comparator is essentially a (dynamic) phase detector, just like what you would have in a PLL - when 1 pulse comes in later than the other pulse, the output voltage, generated via a pwm module, goes up. When the two pulses are synchronized - constant lag between the two pulses, the output voltage is constant.This creates a way to synchronize or discipline a local high frequency oscillator to a low frequency (1pps in this case) signal generated by a reference oscillator, like a gps or Rb-based oscillator.Time for experiment.

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 09:09:20 am
content: I took my 1pps comparator and a 1pps generator powered by a TCO-919R vctcxo. The same software as used before.The reference signal, in this particular case, came from another TCO-919R based 1pps generator but it could be a gps module generating 1pps. It comes into the 1pps comparator / phase detector at pin INT - the INT pin starts the phase detection and a larger lag to a rising edge on the INT pin (meaning the oscillator being disciplined is running slower with regards to the reference oscillator). This set-up provides a negative feedback loop as the TCO-919R outputs a higher frequency signal if the voltage on the control pin goes up.The picture below shows the set up. On the right is the 1pps generator - it takes a 19.44Mhz signal from the TCO-919R and creates a 1pps signal feeding the 1pps comparator's RA1/Pin12. The TCO-919R's output frequency is controlled by a voltage on its pin 1 - where a trimmer (unused) sits.The pic16f684 on the left is our phase comparator. It takes a 1pps reference signal from another 1pps generator powered by a TCO-919R (not shown), and that reference signal goes to the INT/PIN11. The output, in pwm format, goes to a low pass filter to create an analog signal. That analog signal is feed back to the TCO-919R.As we indicated earlier, the output will stablize when the two signals are synchronized.Here, for this particular TCO-919R, the control signal eventually settled on 1.583v - after maybe 3 - 4 minutes. The voltage level is quite solid, as you can connect and disconnect any one of the two oscillators and it will eventually gravitate towards 1.583v.So here you go, a disciplined oscillator that can be built using maybe $5 in parts (not counting the TCO-919R oscillator or the reference signal), on a tiny breadboard.And if you feed the phase detector with a 1pps signal generated by a gps, you get yourself a gps disciplined oscillator.Its advantage? Unlike the typical 10Mhz gps disciplined oscillators, this GPSDO works on (practically) any VCXO/VCTCXO - the limitation is that as long as the frequency can be divided to produce a 1pps signal. This includes most of the frequencies you would encounter. But frequencies with large prime numbers will not work here.Enjoy.

author: codeboy2k
author_rank: Super Contributor
timestamp: May 28, 2015, 04:37:33 am
content: Reviving an old thread, this thread was pointed to by Paulie from the more recentCheap GPSDOthread here:https://www.eevblog.com/forum/projects/cheap-gpsdo/msg680829/#msg680829I hadn't seen it before now, so I read everything from the beginning and I remembered I had seen this done before somewhere so I started searching...First off, to danny, great job and thanks for sharing your results and your code. I think your threads are full of useful information as you document your thought processes from an idea to completion. In this case, I think you might have rediscovered something that was done back in 2006 and published in QEX magazine:http://www.ko4bb.com/manuals/download.php?file=02_GPS_Timing/VE2ZAZ_GPS_Derived_Std_QEX_09_10_2006.pdfThe author's original website is here :http://ve2zaz.net/GPS_Std/GPS_Std.htmand contains the PIC firmware (not source code) to the GPSDO in the article.Your firmware doesn't have the RS232 control inputs, nor the 1Mhz, 5Mhz and 10Mhz dividers and output drivers, but it's clearly a similar approach to the QEX article and one that works well. Your re-discovery is a testament to your skills and thought processes.Good job, once again!Cheers!

author: paulie
author_rank: Frequent Contributor
timestamp: May 30, 2015, 02:36:34 pm
content: Looks like dannyf may have moved on to greener pastures. Maybe due to that "moderation event" just prior to his last post. Unjustified IMO but the the vagaries of over excitable moderators is beyond our control. Too bad because he was one of the top innovators in spite of oddball personality. RIP.ps. Just when he was getting the hang of including "build friendly" wiring info and hex files. What a shame.