Digital Crystal Oscillator

I've read the Green Arrays web page app note on using a pin to turn a crystal into an oscillator at

formatting link

Although the work they did seems to work well enough, they stopped working on the project a long way short of having an actual oscillator. I've been trying to run a spice simulation to explore this concept and finding that an oscillator is not so easy to design... as I already knew.

Has anyone designed what I would call a digital crystal oscillator before? Using Google I didn't find anything that actually uses digital logic, or in this case software to act as the amplifier of a crystal oscillator. Many designs use an inverter as an amplifier, either from a digital logic chip or contained within a digital chip like a MCU. But I can't seem to find any mention of an oscillator that uses a "kick" from a truly digital controller.

From the simulations I have done, I am finding it hard to create just the right conditions to make this idea work. Anyone know anything about how to make a crystal oscillate using a digital drive controller?

Rick

Reply to
rickman
Loading thread data ...

I started to get lost about half way through your posting. There are plenty of schematics on the web for 'crystal oscillators' using ICs, both analog and logic, but the post seems to be referencing something different, more like the feedback loops that are used with atomic clocks. These keep a reference cell containing something like Cesium at a resonant point, by some sort of peak detection principle. It's way more complex than simply closing a gain loop around the resonant element and letting the whole thing oscillate by itself. If you need something other than that, you need to explain exactly what alternative characteristics are important for you. I can't imagine why a simple oscillator wouldn't suffice unless your requirements are specialised.

Reply to
Noodnik

Either they never got it working, or they suddenly realized in all their babbling about "making extra components do their work" that they were replacing --> one stinking transistor

Reply to
Tim Wescott

If you were hell-bent on using a single pin for the crystal, I'd think that it would be cheaper and easier to use an internal clock for whatever it is you need a clock for and periodically shock the crystal into resonance, measure the frequency over n cycles and sync your internal clock to it.

Reply to
Jim Stewart

What internal clock?

I don't know that I am "hell-bent" on using a single pin. But I can't think of a simple way to do any better using two pins. One issue is whether the input pin will need to be biased near the threshold and, if so, how to do it. I think this can only be done using two pins, but I'm not sure.

Rick

Reply to
rickman

Their paper looks to be based on a 'frequency seek' basis

This is the statement I found most revealing:

["We have to hit the right period =B11 count in order to hit the resonance, and the peak to peak voltage immediately drops by a factor of two or more when we are off this peak. Given that the period is on the order of 12000 counts, this means the useful resonance is on the order of 250 parts per million in period variation. "]

So, yes, it can be made to work, BUT to 'lock' to 32KHz, they need

12000 counts per period, and that maps to ~393MHz.

So it certainly makes no power-budget sense to be doing this. You get the worlds highest power, and most complex, 32KHz oscillator ;)

I've seen single pin ceramic resonator oscillators on Philips remote control devices, but that was a special cell, not a generic digital pin.

We had some success in using a HC14 Schmitt, and a crystal with RC feedback. The RC oscillates, and self-biases the pin, and then the Crystal pulls and finally dominates the frequency. Caveats are you need to approach from below, but not too far below, and proving you _are_ crystal locked is non trivial. (Remove the Xtal, and this still oscillates!)

It is still hard to meet any power budget doing this (Vanilla Logic pins have lousy thru currents), and a current-feed inverter is the best topology for low power crystal.

It gets hard to improve on 74LVC1GX04 / 74AUP1Z04 type devices. Multi sourced, and reliable, and a tolerable price. (tho why they cost more than a 2G17, has to be pure marketing...)

-jg

Reply to
malcolm

Single pin crystal oscillators for ICs do exist. Ferranti/Interdesign did it that way:

formatting link

I remember Mitel had a 1 pin circuit in 1988 for their MT3070/MT3071 8 pin DTMF receivers in the sample datasheet. By the time these went into production it was a normal 2 pin gate oscillator again ...

MfG JRD

Reply to
Rafael Deliano
[...]

With only _one_ connection to the XTAL-capacitor-network? Or the usual Pierce circuit?

[...]

It's trivial to build a reliable crystal oscillator with a single BJT and two capacitors.

Oliver

--
Oliver Betz, Muenchen (oliverbetz.de)
Reply to
Oliver Betz

With the right transistor (or JFET) it is possible with only one capacitor.

Reply to
Rocky

I forgot to mention two resistors.

I also count parasitic capacitance as "capacitor".

Oliver

--
Oliver Betz, Muenchen (oliverbetz.de)
Reply to
Oliver Betz

You must admit, the circuit will confuse a neophyte. Crystal into an emitter follower that has the output bypassed!

Reply to
Rocky

You need to learn more about the chip than the little bit indicated in the paper. This chip is an array of 144 async clocked processors, each one using very little power and capable of being stopped and restarted with very, very little wasted time and power. The reason they have to frequency "hunt" is because the speed of the processor is not fixed by a clock (drifts with temperature, voltage and process) so there is no way to know the loop iteration count to use.

They didn't really finish the paper to the point of having a clock oscillator, they just explored the practicality of using a crystal in this manner. Still, there are design issues to be dealt with.

As to the power issue, the SW counting loop is just to kick the oscillator off. At that time the processor is drawing about 5 mA at

1.8 volts, less power than many oscillators use all the time! Once the crystal is ringing, the output is tristated and the processor stops, waiting for a threashold crossing of the crystal voltage. When that occurs the idea is that the processor wakes up, delivers a "push" to the crystal and goes back to sleep waiting for the next threashold crossing. Of course, if the processor has other things to do, it can do then instead of waiting. But it should be back to sleep before the next threshold crossing since the wakeup has very little delay and much less variation in delay, making the timing of the "push" very consistent.

The sourcing of an extra part is not a benefit nor is the pricing. But a conventional oscillator might work better than letting the software manage a crystal. But the proof of the pudding is in the eating!

So far, I have found a design that simulates finally. I had to "push" the crystal on both the rising and falling edges of the waveform to keep from "pushing" it off the page! I don't like the shape of the resulting waveform, it is distorted from a sine wave by the push. I'm not sure why it seems to need so much energy to keep it going. The only power dissipation is the 30 ohms internal resistance of the crystal and a 50 kOhm Thevenin equivalent of the biasing circuit. I'll play with the push circuit a bit to see what tradeoffs seem to make sense.

Rick

Reply to
rickman

A hc14 is always a two terminal oscillator.

devices.

but that's only 'solved' half the problem - you also need to square the sine, to make it digitally useful. Feed a sine straight into a generic pin, and you will have high Icc levels, and/or unreliable clocking

Hitting sub 1uA is also quite hard with a single BJT, but a little easier with a Dual NPN/PNP, bases tied and current fed.

So, any real oscillator, has to comprise a matched Amplifier and Buffer

-jg

Reply to
malcolm

Perhaps., but don't forget to check the buffer current, running in this mode.

If you just want to wake up at known speeds, then perhaps a HC4060/ LVC4060 as that will operate a 32KHz Osc, at the right Vcc.

Current feed of Oscillators, we have found works well.

-jg

Reply to
malcolm
[...]

using a schmitt trigger inverter for a Pierce crystal oscillator is usually a very, very bad idea.

A crystal oscillator is an analog thing, and it should run with an analog amplifier, i.e. an unbuffered CMOS inverter - just a single stage.

[...]

O.k., I didn't consider we are talking about low frequency, low power oscillators.

[...]

Only for low frequency oscillators. At several MHz you rarely need the buffer.

Oliver

--
Oliver Betz, Muenchen (oliverbetz.de)
Reply to
Oliver Betz

Yes, but this is a 'can it be done' thread, not a 'is it a good idea' thread ;) ( see my caveats)

Yes, which is what you will find in the part numbers I suggested :

- A linear state, and a schmitt buffer. If your target has schmitt pins, with low threshold currents, then some cents can be saved using a 2GU04.

32.768KHz is usually placed in the ow frequency, low power basket, at least here.

Again, it depends on if you are 'making it work', or designing it properly.

Provided you meet a slew-minimum, even a non schmitt digital pin can be made to work. - but lower amplitudes (Xtal Startup) mean lower slew, and temperature and voltage move Slew limits about too....

-jg

Reply to
malcolm

...snip...

I figured out how to make this oscillate. When just pinging it in one direction the impulse would be too great and push the bias voltage of the xtal away from the threshold of the input. Then it would drift back and oscillate in spurts. Using a balanced impulse drive and adding a current limiting resistor seems to do the trick. I used some digital logic functions in LTSpice to emulate the functionality of the software.

But after some testing with the threashold displaced from exactly the center of the power-ground range, it seems this unbalances the drive and pushes the bias level of the oscillations in the other direction. The end result is that the signal eventually stops crossing the threashold and the oscillations die out.

So it turns out it may not be possible/practical to digitally drive a crystal into stable oscillation from a single pin.

Rick

Reply to
rickman

I didn't know about the leasing, Linnix. Haven't had time to get to that point in my reading. I did think that since it was so cheap that some may just use the discovery board for small projects.

Say, how did you smoke your board? Your suggestions may save my two boards.

Joe

Reply to
justme

I've spent some more time with the simulation looking at alternative ways to make it work and I'm pretty sure a single pin for stimulation and observation is not practical. The problem is that the input threashold is not set exactly in the center of the power-ground range. Any displacement causes the two pushes (positive or negative) to unbalance and move the bias point in the opposite direction of the threashold. With even a modest offset in the threshold the oscillations end up not crossing the threashold and operation stops.

I'm going to explore a two pin approach.

Rick

Reply to
rickman

You seem to understand crystals way better than I do. So I have a few questions below.

They try to get as near as possible to the resonant frequency by a software loop, with 2.5 nS resolution for the period. As you can see, they force the power voltage with a low impedance directly on the crystal. This is 1.8 V but anyway, 32 kHz crystals are large and robust (?)

Now do you understand what happens here? They impose a 1.8 V square wave of 32 Khz resonance directly on the crystal for slightly more than half a second. Then they stand back, high impedance mode. Then the voltage over the crystal builds up taking another 500 mS, before dying out. The top-top value of this is more than the 1.8V they put in. (They use a 10 pF scope probe, which is the same order of capacitance as the crystal's parasitic capacitance, which is another thing I understand not enough to take into account.)

This is not just a single pin oscillator. This is one hanging off a digital output. The rule of the game is to drive at power line voltages only. You can only pick the moment.

P.S. the GA 144 has a minimum of resistive elements, because "dissipation wastes energy" as the inventor says. This is another experiment in this direction. It may be a hobby horse.

Groetjes Albert

--

--
Albert van der Horst, UTRECHT,THE NETHERLANDS
Economic growth -- being exponential -- ultimately falters.
albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
Reply to
Albert van der Horst

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.