Close

Crystal oscillator with complementary MOSFETs

A project log for Yet Another (Discrete) Clock

I HAD to finally do this basic "exercice de style" in digital electronics, using some hundreds of transistors and diodes...

Yann Guidon / YGDESYann Guidon / YGDES 02/17/2016 at 22:5321 Comments

(this discussion is continued in Oscillators' basics)


In the beginning, there was the original beat. The tightly controlled frequency of a precisely cut quartz crystal that sets the rythm of the rest of the circuit.

Getting this crystal is easy today, getting it to oscillate properly is a totally different thing. Making it work with a discrete complementary MOSFET driver is yet another story.

Half a century ago, our predecessors would use a pair of NPN to run a watch out of a 8192Hz crystal and a small coin battery:

(source: http://ethw.org/First-Hand:The_First_Quartz_Wrist_Watch)

I haven't seen this topology used since then, people use these circuits instead today:

(see http://www.bowdenshobbycircuits.info/page11.htm)

Oh wait, the 2N2904 is a PNP, not NPN type... wth ?


I have already explored discrete Xtal oscillator circuits at https://hackaday.io/project/8121-discrete-yasep/log/26870-clock-generation-circuit but 32KHz is a different and more sensitive domain.

For our purpose, the left circuit (similar to the higher frequency one) is not accepted because it uses an integrated circuit. That would be too easy. On the right, it uses a single bipolar transistor (how 70's !) and the 68K pull-up wastes energy. I want a low-power full CMOS design. Just because.

In theory, the 4069 inverter gate should be easily replaced by a pair of complementary MOSFET. This raises the question of the influence of the combined gate capacitances.


Not shown is the series resistor that K.C. suggested in the comments, I'll have to try it before I commit to the design. For now I'm trying to KISS.

Also missing is a LC filter between the P-MOSFET and VCC.

Discussions

Yann Guidon / YGDES wrote 02/20/2016 at 00:21 point

I just found this picture at  http://www.sentex.ca/~mec1995/tutorial/xtor/xtor10/xtor10.html

I don't see what I did wrong with my implementation.....

  Are you sure? yes | no

K.C. Lee wrote 02/23/2016 at 00:04 point

BTW I tried a few things in LTSpice and couldn't get the circuit with discrete MOSFET to oscillate (in transient analysis).  In AC analysis, the overall gain is around 2dB which means that there is almost no gain.  That's probably why it won't oscillate.  

The circuit fig 24 is from a CMOS CD4007 chip.

  Are you sure? yes | no

K.C. Lee wrote 02/23/2016 at 00:21 point

I tried using 3 stages of inverters, with 100K resistors in series to source pin (similar to the fig 24) and at 5V (not 3V), I see oscillation.

https://cdn.hackaday.io/images/1568021456186870037.png

The series resistors on the input stage is needed as it also isolate the gate capacitance from the crystal.  

The simulation works for the next 2 stages without the resistors.  You would want to have a series resistor to the crystal as that would over drive the crystal (typically rated for 1mW).

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/23/2016 at 01:27 point

Impressive...

And if it still doesn't work, I'll see what happens with a single MOSFET, i've found a couple of schematics. Maybe it asymmetric topology solves the issue.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/23/2016 at 01:39 point

In your schematic, I don't see the series resistor between the gate and the xtal. What value is recommended ? Can you simulate for different values and see which works best ?

  Are you sure? yes | no

K.C. Lee wrote 02/23/2016 at 02:02 point

The resistor at the source is in series with the gate capacitance, so it would decrease the amount of load seen by the crystal.  There is a "Reverse Transfer Capacitance", but it is on the order of 4-5pF.

  Are you sure? yes | no

K.C. Lee wrote 02/23/2016 at 02:20 point

I only did the simulation because I fired up the simulator for something else.  I can give you the LTSpice files to play with.

https://hackaday.io/project/7700-collection-of-misc-small-project/files

the .asc is the LTSpice file, .cir is regular spice netlist and the .lib is the MOSFET model that comes with LTSpice.  

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/23/2016 at 02:35 point

Ah I get it ! it's in series with source and drain, not the gate............... i was so slow to catch this detail !

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/19/2016 at 13:32 point

http://www.bowdenshobbycircuits.info/page11.htm

The first circuit has a curious Xtal oscillator made of a pair of HC14:

I have first seen this topology used with the #Charleplex Xmas Tree without uC and a pair of HC04 gates but I didn't think it was possible to do it with a crystal...

  Are you sure? yes | no

K.C. Lee wrote 02/18/2016 at 00:20 point

Could also try a series resistance on the input to the inverter to isolate the capacitance load seen by the crystal. It is sort of like 10X passive scope probes introduces a lower capacitive load to the test circuit.

The inverter would see a smaller amplitude, but that is a different issue to solve.  You could play around with the circuit gain to get it to work.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/18/2016 at 00:23 point

That series resistor is a pretty smart idea ! I'll keep this in mind :-)

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/18/2016 at 03:45 point

Wait...
If the series resistor "isolates" the gate capacitance from the quartz then comes the question : how much resistance is needed ?

The logical consequence becomes : if we use an adjustable resistance then this also adjusts the capacitance and the frequency tuning.

Does that actually make sense ?

  Are you sure? yes | no

K.C. Lee wrote 02/18/2016 at 04:27 point

The resistor would be the lossy element affecting the Q factor.  I don't know how much it would pull the resonant frequency.  I would use a fix value and just play with the cap

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/18/2016 at 05:39 point

So... no resistor...

  Are you sure? yes | no

K.C. Lee wrote 02/18/2016 at 04:23 point

I have no idea how much resistance is needed of the top of my head as it would require knowing the model for a crystal and running simulations.  To be honest I have not seen it used. Not an analog guy.

50pF cap at 32kHz has an impedance about 100K.  100K would be a good starting point and that would reduce some of the effects of the capacitance. Too small would have little effects and too high would attenuate the input to the inverter.  

Bring the impedance up to 200K would be similar to the norminal 25pF cap.  You should add external cap in its place as you do need its more stable capacitance to dominate.  The input of the inverter would now be attenuated by a factor of 2.

BTW that particular datasheet 35K max ESR figure for the crystal.  So that give you an idea of order of magnitude of loading.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/19/2016 at 03:24 point

Well... i just wired it, the 10M feedback resistor sets the working voltage to approximately mid-Vcc. And nothing.

Touching the crystal's pins adds some parasites but the scope (at 10×) does not show any sign of resonance. My circuit does not seem to want to oscilate.

  Are you sure? yes | no

K.C. Lee wrote 02/19/2016 at 04:31 point

May be plan B using BJT?
http://www.discovercircuits.com/DJ-Circuits/ultralowpwrxtlosc1.htm

>With the components show, the current from a 3v battery is less than 1.2 microamps

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/19/2016 at 12:06 point

I'll see if it works... The BJT's output should be buffered because the amplitude is too low.

Maybe one inverter was not enough and it becomes metastable, so a couple of additional inverters would force the output to reach the rails, and start oscillation ?

I could replace the MOSFETs with a LVC1G04 and check if it oscillates...

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/19/2016 at 12:45 point

I must have gotten the caps wrong as well but the absence of overshoot when I touch the wire looks like the crystal might not work ? More work is required...

Or the series resistance (300K) is too high ?

  Are you sure? yes | no

K.C. Lee wrote 02/17/2016 at 23:55 point

The gate capacitance of 2N7002/BSS84 are about 20/25pF.  So the input is about 50pF or so and you can probably get rid of the external cap at the input.

With another 50pF cap on the right side, the equivalent cload is 25pF.  While this might be twice as large as the recommended value, it seems to be still within the curve on page 2. Now this might not give you the most accurate clock.

http://datasheet.octopart.com/T26-32.768K-12.5P-Mercury-United-datasheet-10040216.pdf 

The large series resistance isolate the crystal from the output capacitance, so you could play a little bit with the cap on the right side to reduce the value of cload as series capacitance seen by the crystal to trim the frequency.

  Are you sure? yes | no

Yann Guidon / YGDES wrote 02/18/2016 at 00:03 point

Hmmm.... at this moment I'm drawing the schematic so I try to understand what you mean.

I try to "make it work", not reach rubidium-class accuracy, and I have some TCXO to help tune the oscillator. Some adjustable capacitors are available as well.

The capacitance of the MOSFET might change with temperature, voltage etc. so isn't it a liability ?

  Are you sure? yes | no