I've been looking for an example of using a crystal oscillator.

I found this package in LTspice by a person named Bordodynov. In this package, I found a quite simple implementation. I'm re-uploading the *.asc file for your convenience. (Ctrl+S on the text view.)

enter image description here

I've got to admit, I don't understand the circuit. I understand the IC is functioning as an inverter and the crystal introduces a delay as it swings between high and low (or else the inverter would swing wildly or settle midway.)

First off, I need to change the frequency. Thinking it only lies on the crystal and the LTspice native xtal is used, I tinkered with xtal's series R,L,C (\$f = \frac{1}{2\pi\sqrt{LC}}\$) and parallel C\$_p\$. It didn't change the frequency. I suppose it has to do with the RC on the negative feedback.

Second, the duty cycle of the square wave is less than 50%. I may need it to be larger than that.

Third, what's the voltage divider for?

Giving me quick formulas is more expedient rather than going through the hoops of a detailed explanation.

EDIT: I only wish to change the properties, such as frequency, during simulation; not real time.

  • \$\begingroup\$ It is a quartz resonator. Reasonable is mechanical. \$\endgroup\$
    – user263983
    Jul 5, 2022 at 3:09
  • \$\begingroup\$ You can't change the frequency. Or at least, not by much. A quartz "watch" crystal, due to it's mechanical properties, wants to vibrate at 32.768kHz. You can force it a bit faster or slower, but the more you try to push, the harder it will be to do so. If you want an adjustable oscillator, look at some other circuits (that likely don't have quartz crystals). You can substitute other quartz crystals but that 32k is a pretty 'standard' one (used in wrist watches). Most others I've ever seen are made to vibrate at megahertz or higher. \$\endgroup\$
    – Kyle B
    Jul 5, 2022 at 3:55
  • \$\begingroup\$ What frequency do you need to change it to? What duty cycle might you need? \$\endgroup\$ Jul 5, 2022 at 5:50
  • \$\begingroup\$ I think you could ask your question more clearly, but upvote, because is interresting. \$\endgroup\$ Jul 5, 2022 at 10:15
  • \$\begingroup\$ This crystal is xtal is found in LTSpice's standard library. It can't be fixated in just one frequency, as that is one of the most important parameters. \$\endgroup\$ Jul 5, 2022 at 16:37

4 Answers 4


Firstly, the so-called op-amp (LTC1441) used in the OP is in fact a rather slow comparator with built-in hysteresis (totally undesirable for this type of circuit). And, this brings another set of problems that, for the main are going to be ignored in this answer. For the remainder of this answer, I shall call the active device an op-amp and assume that it is a reasonably fast device when operated in its linear region.

I understand the IC is functioning as an inverter & the crystal introduces a delay as it swings between hi & lo (or else the inverter would swing wildly or settle midway).

No, that is incorrect. The op-amp has the crystal connected from output to non-inverting terminal and therefore the op-amp is functioning as a non-inverting amplifier. The crystal doesn't introduce any phase lag or lead at the oscillation frequency. Positive feedback at that oscillation frequency ensures that the op-amp produces a square wave because the output hits the power supply rails.

Information: it's a poor, poor circuit for a crystal oscillator.

Second, the duty cycle of the square wave is less than 50% & I may need it to be larger than that.

Because you are driving the op-amp into output saturation, the time it takes to recover from saturation on the positive rail may be significantly less than the time it takes to recover from the negative rail hence, it's a poor circuit for a crystal oscillator.

Third, what's the voltage divider for?

It acts as a centre-rail DC bias for the op-amp and a resistive load for the crystal.

  • 1
    \$\begingroup\$ The focal point of this funny design probably was low current consumption. The "last page circuit" in LT datasheets often contains solutions with humorous and absurd aspects. \$\endgroup\$
    – Jens
    Jul 5, 2022 at 13:25
  • \$\begingroup\$ What sold me was the low BOM. I'll see if I can whittle it down further. The Pierce & Colpitts crystal implementation has more parts. \$\endgroup\$ Jul 5, 2022 at 18:26
  • \$\begingroup\$ @TempusNomen then why not buy a 32 kHz oscillator module = 1 part. \$\endgroup\$
    – Andy aka
    Jul 5, 2022 at 18:55
  • \$\begingroup\$ Like these ones: datasheets.maximintegrated.com/en/ds/MAX7377.pdf? Contemplating it. I want common types of parts, even though I may go on the high end when ordering online. \$\endgroup\$ Jul 6, 2022 at 1:23
  • \$\begingroup\$ Product recommendation requests are off-topic for this site even if you specify the part because, to make a decent answer, I'd need to know the full specification of your requirements and spend hours examining your needs against Maxim's offerings and, that ain't gonna happen. No, it's not the type I was thinking of. \$\endgroup\$
    – Andy aka
    Jul 6, 2022 at 7:07

If you substitute C1 for a resistor, you obtain a relaxation oscillator. Ideally, you use a comparator with push-pull-capable output with it.

That new resistor should be about an order of magnitude larger than R1||R2, so it is easier to make the latter two a little bit smaller.

Its frequency and duty cycle is then tunable over many many orders of magnitude, mainly via the R3-C2 time constant. I have used such circuits at around 1 Hz and around 1 MHz, but it can be tuned much wider.

  • \$\begingroup\$ The LTC1441 it's TTL output with 40mA source & 5mA sink. Is that not enough? \$\endgroup\$ Jul 5, 2022 at 17:30
  • \$\begingroup\$ @TempusNomen it is plenty. Make sure to not use more than 1 mA (limited by the two feedback resistors and any potential load) and it should be pretty symmetric. \$\endgroup\$
    – tobalt
    Jul 5, 2022 at 17:47

enter image description here

If you want a simple oscillator circuit based on a crystal, with few parts and low cost, a Pierce oscillator with a JFET, like this sort of thing, might be a good choice.


If your problem is modeling the LTSpice crystal, I found a handy example that automatically configures the parameters based on the frequency desired. The original was on my computer as: C:\Users\paul\Documents\LTspiceXVII\examples\Educational\contrib\qztst.asc

I modified it for 32768 Hz.

Crystal Test 32768

Here is the ASCII file:

Version 4

SHEET 1 3040 2464 WIRE 1712 2192 1632 2192 WIRE 1824 2192 1792 2192 WIRE 2000 2192 1888 2192 WIRE 2048 2192 2000 2192 WIRE 1632 2208 1632 2192 WIRE 2000 2208 2000 2192 WIRE 1632 2304 1632 2288 WIRE 2000 2320 2000 2288 FLAG 2000 2320 0 FLAG 1632 2304 0 FLAG 2048 2192 OUT SYMBOL MISC\XTAL 1824 2208 R270 WINDOW 0 32 32 VTop 2 WINDOW 3 0 32 VBottom 2 SYMATTR InstName Y1 SYMATTR Value {Cs} SYMATTR SpiceLine Rser={Rs} Lser={Ls} Cpar={Cp} SYMBOL VOLTAGE 1632 2192 R0 WINDOW 123 24 132 Left 2 WINDOW 39 0 0 Left 2 SYMATTR Value2 AC 2 SYMATTR InstName V1 SYMATTR Value "" SYMBOL res 1808 2176 R90 WINDOW 0 0 56 VBottom 2 WINDOW 3 32 56 VTop 2 SYMATTR InstName R1 SYMATTR Value 50 SYMBOL res 2016 2304 R180 WINDOW 0 36 76 Left 2 WINDOW 3 36 40 Left 2 SYMATTR InstName R2 SYMATTR Value 50 TEXT 1672 2104 Left 2 !.ac lin 1001 32700 32800 TEXT 1184 2048 Left 2 ;Crystal model from easily measurable parameters TEXT 1136 2112 Left 2 !serial freq\n.params fs=32768\ndifference between serial and // freq \n.params df=10e3 \n.params Rs=50\n.params Cp=4e-12\n.params Cs=2.0cpdf/fs\n.params Ls=1/(4pipifsfs*Cs) TEXT 1592 2392 Top 1 ;This example schematic is supplied for informational/educational purposes only.\nContributed by Dominique Szymik.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.