EmbeddedRelated.com
Forums

Digital Crystal Oscillator

Started by rickman December 27, 2010
On Dec 29, 6:19=A0pm, Oliver Betz <OB...@despammed.com> wrote:
> Rocky wrote: > >> It's trivial to build a reliable crystal oscillator with a single BJT > >> and two capacitors. > > I forgot to mention two resistors. > > >With the right transistor (or JFET) it is possible with only one > >capacitor. > > I also count parasitic capacitance as "capacitor". >
You must admit, the circuit will confuse a neophyte. Crystal into an emitter follower that has the output bypassed!
On Dec 28, 9:38 pm, malcolm <malcolm...@gmail.com> wrote:
> On Dec 29, 7:17 am, rickman <gnu...@gmail.com> wrote: > > > What internal clock? > > 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 ;)
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.
> 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...)
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
On Dec 30, 2:44=A0am, Oliver Betz <OB...@despammed.com> wrote:
> malcolm wrote: > > [...] > > > We had some success in using a HC14 Schmitt, and a crystal with RC > >feedback. The RC oscillates, =A0and self-biases the pin, and then the > >Crystal pulls =A0and finally dominates the frequency. > > With only _one_ connection to the XTAL-capacitor-network? > Or the usual Pierce circuit?
A hc14 is always a two terminal oscillator.
> > [...] > > > It gets hard to improve on =A0 =A0 =A0 =A0 74LVC1GX04 / 74AUP1Z04 type =
devices.
> > It's trivial to build a reliable crystal oscillator with a single BJT > and two capacitors.
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
On Dec 30, 10:39=A0am, rickman <gnu...@gmail.com> wrote:
>=A0Once the crystal is ringing, the output is tristated and the processor > stops, waiting for a threashold crossing of the crystal voltage. =A0When > 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. =A0
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
malcolm wrote:

[...]

>> > We had some success in using a HC14 Schmitt, and a crystal with RC >> >feedback. The RC oscillates, &#4294967295;and self-biases the pin, and then the >> >Crystal pulls &#4294967295;and finally dominates the frequency. >> >> With only _one_ connection to the XTAL-capacitor-network? >> Or the usual Pierce circuit? > >A hc14 is always a two terminal oscillator.
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. [...]
>> It's trivial to build a reliable crystal oscillator with a single BJT >> and two capacitors. > >but that's only 'solved' half the problem - you also need to square >the sine, to make it digitally useful.
O.k., I didn't consider we are talking about low frequency, low power oscillators. [...]
> So, any real oscillator, has to comprise a matched Amplifier and >Buffer
Only for low frequency oscillators. At several MHz you rarely need the buffer. Oliver -- Oliver Betz, Muenchen (oliverbetz.de)
On Dec 30, 11:50=A0pm, Oliver Betz <OB...@despammed.com> wrote:
> malcolm wrote: > > [...] > > >> > 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. > > >> With only _one_ connection to the XTAL-capacitor-network? > >> Or the usual Pierce circuit? > > >A hc14 is always a two terminal oscillator. > > using a schmitt trigger inverter for a Pierce crystal oscillator is > usually a very, very bad idea.
Yes, but this is a 'can it be done' thread, not a 'is it a good idea' thread ;) ( see my caveats)
> 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.
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.
> > >> It's trivial to build a reliable crystal oscillator with a single BJT > >> and two capacitors. > > >but that's only 'solved' half the problem - you also need to square > >the sine, to make it digitally useful. > > O.k., I didn't consider we are talking about low frequency, low power > oscillators.
32.768KHz is usually placed in the ow frequency, low power basket, at least here.
> > So, any real oscillator, has to comprise a matched Amplifier and > >Buffer > > Only for low frequency oscillators. At several MHz you rarely need the > buffer.
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
On Dec 26, 11:46 pm, rickman <gnu...@gmail.com> wrote:
> I've read the Green Arrays web page app note on using a pin to turn a > crystal into an oscillator at > > http://www.greenarrays.com/home/documents/pub/AP002-OSC.html
...snip...
> 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?
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
On Dec 27, 2:55 am, Tim Wescott <t...@seemywebsite.com> wrote:
> On Sun, 26 Dec 2010 20:46:26 -0800, rickman wrote: > > I've read the Green Arrays web page app note on using a pin to turn a > > crystal into an oscillator at > > >http://www.greenarrays.com/home/documents/pub/AP002-OSC.html > > > 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? > > 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 <-- with a bazzilion of them. > > From the general tone of the article, either they don't know what the > heck they're doing, or they're _really_ talking down to the audience. > Their surprise at needing to give a crystal -- famous for being a Really > High Q Device -- lots of cycles of excitation before they see an output > tends to indicate happy ignorance rather than arrogant competence. > > If they were driving the pin directly into the crystal at its series > resonant frequency they were probably way over-exciting it. > > Making a single-pin crystal oscillator is probably doable. Particularly > if you're willing to go for the crystal's parallel resonance mode, you > should be able to set up a pure negative resistance at a pin, turn it on, > and stand back. Figuring out the complications is, of course, left as an > exercise to the reader. > > --http://www.wescottdesign.com
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
In article <4NWdnWqxetTu24XQnZ2dnUVZ_rednZ2d@web-ster.com>,
Tim Wescott  <tim@seemywebsite.com> wrote:
>On Sun, 26 Dec 2010 20:46:26 -0800, rickman wrote: > >> I've read the Green Arrays web page app note on using a pin to turn a >> crystal into an oscillator at >> >> http://www.greenarrays.com/home/documents/pub/AP002-OSC.html >> >> 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? > >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 <-- with a bazzilion of them. > >From the general tone of the article, either they don't know what the >heck they're doing, or they're _really_ talking down to the audience. >Their surprise at needing to give a crystal -- famous for being a Really >High Q Device -- lots of cycles of excitation before they see an output >tends to indicate happy ignorance rather than arrogant competence.
You seem to understand crystals way better than I do. So I have a few questions below.
> >If they were driving the pin directly into the crystal at its series >resonant frequency they were probably way over-exciting it.
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.)
> >Making a single-pin crystal oscillator is probably doable. Particularly >if you're willing to go for the crystal's parallel resonance mode, you >should be able to set up a pure negative resistance at a pin, turn it on, >and stand back. Figuring out the complications is, of course, left as an >exercise to the reader.
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.
> >-- >http://www.wescottdesign.com
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
On 01/03/2011 10:30 AM, Albert van der Horst wrote:
> In article<4NWdnWqxetTu24XQnZ2dnUVZ_rednZ2d@web-ster.com>, > Tim Wescott<tim@seemywebsite.com> wrote: >> On Sun, 26 Dec 2010 20:46:26 -0800, rickman wrote: >> >>> I've read the Green Arrays web page app note on using a pin to turn a >>> crystal into an oscillator at >>> >>> http://www.greenarrays.com/home/documents/pub/AP002-OSC.html >>> >>> 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? >> >> 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<-- with a bazzilion of them. >> >> From the general tone of the article, either they don't know what the >> heck they're doing, or they're _really_ talking down to the audience. >> Their surprise at needing to give a crystal -- famous for being a Really >> High Q Device -- lots of cycles of excitation before they see an output >> tends to indicate happy ignorance rather than arrogant competence. > > You seem to understand crystals way better than I do. > So I have a few questions below. > >> >> If they were driving the pin directly into the crystal at its series >> resonant frequency they were probably way over-exciting it. > > 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 (?)
The most commonly available 32kHz crystals are teeny and fragile. They're made for watches, and they come in a can that's about 1mm x 6mm. They're "tuning fork" crystals, which means that they have a notch through the thing to lower the resonance and keep the size low.
> Now do you understand what happens here?
No, the article lacks whole bucket loads of clarity and you haven't supplied much.
> 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.)
So once they've finished dinking around in the lab and they're ready to make this thing _sustain_ oscillations, what do they do? After I wrote the above it did occur to me that you could hit the thing briefly with excitation, then back off for a while and let it ring, then hit it, etc. You could keep the excitation down to a manageable level, that way.
>> >> Making a single-pin crystal oscillator is probably doable. Particularly >> if you're willing to go for the crystal's parallel resonance mode, you >> should be able to set up a pure negative resistance at a pin, turn it on, >> and stand back. Figuring out the complications is, of course, left as an >> exercise to the reader. > > 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.
If it looks like a duck and quacks like a duck, it's a duck. It looks like and oscillator and it acts like an oscillator. Therefor it's an oscillator. Never mind that there's software in there mediating the response -- it's still an oscillator.
> 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.
Well, if he wants his chip to actually work as an oscillator with a crystal on it he can give me a call and I'll make it work -- or tell him why it can't -- at my usual rates. Then I'll write up a coherent white paper that explains _why_ it works, and doesn't leave anyone* thinking that I'm being arrogant, naive, or dense. I don't think you _can't_ make this scheme work -- I just question whether using a few thousand (if it is just a few) transistors to do the job of one is really going to save power, area, or anything else in the end. * Well, except for the obligatory few who will walk away from _any_ document thinking that they're better than the world. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" was written for you. See details at http://www.wescottdesign.com/actfes/actfes.html