External Crystal Input - Suggestions?
Drone
Posts: 433
Hello-All...
How to replace the 5MHz XTAL with an external 5V TTL compatible 5MHz input with good/safe isolation?
I have a GPS disciplined reference clock/oscillator with a 10MHz output at 5V TTL compatible signal levels. I want to use this stable 10MHz reference to replace the crystal input on a propeller via XI. Has anyone done this before? I would like to isolate the GPS reference output with a capacitor and voltage divider perhaps, but maybe I need to use a ferrite transformer instead (worried about possible negative swings appearing on XI, but I think XI is capacitively coupled after deep-searching the forum on this topic)?
I wish the Propeller data sheet had more info about exactly what's expected and produced on the XO and XI pins.
The eventual application is to use the powerful Propeller timer/counters to compare two GPS references. The Propeller would be clocked by a "reference" 10MHz output (through a flip-flop to divide by two to 5MHz in-place of the XTAL) then count between 1 pulse per second inputs tp a Propeller pin from the GPS receiver under test to compare "drift" against the reference. Absolute frequency measurement is not the target, only comparison between the two.
Thanks for any suggestions - David
How to replace the 5MHz XTAL with an external 5V TTL compatible 5MHz input with good/safe isolation?
I have a GPS disciplined reference clock/oscillator with a 10MHz output at 5V TTL compatible signal levels. I want to use this stable 10MHz reference to replace the crystal input on a propeller via XI. Has anyone done this before? I would like to isolate the GPS reference output with a capacitor and voltage divider perhaps, but maybe I need to use a ferrite transformer instead (worried about possible negative swings appearing on XI, but I think XI is capacitively coupled after deep-searching the forum on this topic)?
I wish the Propeller data sheet had more info about exactly what's expected and produced on the XO and XI pins.
The eventual application is to use the powerful Propeller timer/counters to compare two GPS references. The Propeller would be clocked by a "reference" 10MHz output (through a flip-flop to divide by two to 5MHz in-place of the XTAL) then count between 1 pulse per second inputs tp a Propeller pin from the GPS receiver under test to compare "drift" against the reference. Absolute frequency measurement is not the target, only comparison between the two.
Thanks for any suggestions - David
Comments
2) In this case, the XI pin is just a logic input with logic low = 0V and logic high = 3.3V. It has protective diodes on it to ground and Vdd which would limit negative excursions as long as the current is limited. There's a whole thread on attaching 5V logic devices to the Propeller ... have a look through it. Probably the easiest would be a simple voltage divider (forget the capacitor) with a 3.3K resistor between the XI pin and ground and a 1.8K resistor between the XI pin and the TTL compatible output of the clock/oscillator.
3) Running the system clock at 80MHz would give you better resolution.
I should recommend a Schmitt-Trigger near the Propeller input, which - when powered with 3.3, V - also provides an additional protection for the Propeller for the more paranoic... A simple serial 470 Ohms resistor should suffice for the adaption of a 5 V clock; note btw that this resistor forms a low pass with internal input pin capacity!
When you switch clocks, I'd suggest you switch first to the internal RCFAST clock, then change the external clock source, then switch back to the external 5MHz clock after a few milliseconds for the PLL to stabilize. This is a good process for any clock changes. You might not need this because the PLL will tend to smooth out short glitches. I'd check with Paul or Chris since they know much more about the clock generator and PLL than I would.
I have used a similar system at my work. We take our 10MHz rubidium standard and divide it by 2 with a simple flip-flop. Then use that as the input to the propeller.
Using the PLL we run the propeller @ 80MHz. Then we measure 4 100KHz signals (10MHz OCXOs mixed with a 9,900,000 Hz synth, then low pass filtered).
We use a reciprocal counter method to get very good resolution in a small measurement time by counting the system clock for "x" input clocks ("x" depends on the required gate time).
Some preliminary tests yielded excellent results.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
“The United States is a nation of laws -· poorly written and randomly enforced.” - Frank Zappa
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
THank you for the suggestion regarding the switch to internal clock first. I was wrestling with this, knowing that if I just simply switch the clock, even if doing make before break, it would probably cause problems on a running system. Then I though about running all the clock input options through a PLL as a holdover circuit, but that adds another PLL in the system, and I'm trying to do accurate time and frequency measurement - so I tend to shy away from that approach. Maybe I'll just have to live with having the switching arrangement hold the Propeller's reset down while the clock selection is being made. It is acceptable to reboot Propeller during a manual change of the clock input.
Regards,
David
I read your comments about your measurement system with great interest. As stated, my goals are same/similar. This thread is about injecting an alternative clock. I'd like to continue this discussion about your measurement techniques. What do you suggest, a new thread? A new thread might be inappropriate because I don't feel I've thought about the next steps yet. Maybe offline?
David
BTW - I'm in Jakarta
You don't have to reboot the Propeller to change the clock. It has a perfectly usable internal clock (though a bit inaccurate ... RCFAST is somewhere between 8-20MHz and is temperature sensitive ... ok where accurate timing isn't necessary). Read the section of the Propeller Manual on the CLKSET statement. It describes how to switch the clock from internal to external. The process includes a 10ms delay when you're using an external crystal to allow the oscillator to stabilize. That should not be needed for an external oscillator. The Propeller only needs 75ns to actually switch the clock source.
Why not let the Propeller switch the clock? You can use a 1:4 multiplexor like the 74HC153 and two I/O pins.