Crystal controlled oscillator modelling in LTSpice

Thread Starter

grenken

Joined Oct 29, 2020
5
I am trying to model a 16 MHz crystal controlled oscillator in LTSpice. The attached circuit oscillates but I cannot see the output waveform spread out in the plotted output file.

I have modeled a square wave and spread out the waveform from the attached LTSpice Square Wave Circuit Model.

What must I do to the output of the 16 MHz crystal Controlled Oscillator to spread it out?
 

Attachments

Papabravo

Joined Feb 24, 2006
22,066
You square wave is not a square wave -- it is a sine wave, and it plots a couple of cycles in 1 microsecond of simulation time.
The other simulation will probably take several hours to do 1.5 seconds of simulation time, and you apparently do not have the patience to wait for it. You won't get a plot until the simulation is finished. At least have the decency not to mislead us.
 

crutschow

Joined Mar 14, 2008
38,423
Below is the sim of your 16MHz crystal oscillator:
Note the significant changes to the simulation command.

Why did you try to simulate it for 1.5s (appox. 24 million cycles), which takes an eternity of simulation time, as Pb implied?

1724559055381.png
 
Last edited:

sparky 1

Joined Nov 3, 2018
1,218
Good job !!! and Bordodynoff appreciate your work.
The Qorvo Qspice output looks very smooth, setting nmos kp = 1m improves the amplitude Blue and corrects phase 180
Is it possible to measure the current draw on the crystal equivalent section? I use another simulator, the current probe

The picture below Multisim 14, the goal is more current the crystal draws 672uA or 450pW, R1 is only 1M, easy to put together,
I am using 74HC04 2 gates and gates left over, crystal is 16.000MHz 10ppm 18pF the simulation output is square wave output is very symmetrical.
R2 is adjusted until pos and neg pulses are equal. the beauty of using 74HC04 in simulation. R1 ? what current do you want 100uA 10M
The simulation is approximate ( old school no tiny vna for crystal parameters ) The purpose for this could be frequency source with straight edges.

LTSPICE file Below same as above n_mos p_mos pair sinewave except modified for 18pF crystal modified for more current as an example
The 22pF crystal above might be used for example in atmega328 with feedback 1M.
By reading the manual you would see. In other situations you might use any value for example 1M to 10M
It is possible to find the value for R2 and current across crystal using the simulator but the final adjustment
is done on the scope.


16 Mhz crystal Oscillator 74HC04.png
 

Attachments

Last edited:

Bordodynov

Joined May 20, 2015
3,430
Good simulations, but I'm surprised you show plots with unlabeled nodes, so we don't know what's being plotted.
I made a netlist of the LTspice circuit and calculated it, I looked at how labeled (by what names) in LTspice and derived the same nodes in both simulators. But I had to disable the inductance shunting with the resistor. The bypass is available in Qspice and LTspice. It's just different. In Qspice the inductance is shunted more strongly. That's why I made Rpar=0.
Pay closer attention to the difference of amplitudes!
In LTspice the amplitudes are smaller! This is because of the shunt mentioned above. Make Rpar=0 in LTspice and you will get the same result as in Qspice.
Shunting of inductances is of great benefit when calculating power converters - it speeds up and improves convergence. When calculating quartz oscillators it is harmful!
 

Bordodynov

Joined May 20, 2015
3,430
Good job !!! and Bordodynoff appreciate your work.
The Qorvo Qspice output looks very smooth, setting nmos kp = 1m improves the amplitude Blue and corrects phase 180
Is it possible to measure the current draw on the crystal equivalent section? I have square wave draws 672uA at crystal or 450pW
I am using 74HC04 2 gates crystal is 16.000MHz 10ppm 18pF the simulation output is square wave output symetrical has drive.
The simulation is approximate ( sorry no tiny vna ) purpose is microcontroller. ltspice file of mosfet variant attached below.
View attachment 330151
You used the wrong quartz crystal model. It is not for 16 MHz!
Use Thomson's formula.OscxxMeg.png
 

sparky 1

Joined Nov 3, 2018
1,218
After running the numbers using best approximation for motional by Thompson formula
the result was a little better. Remember I am adjusting the parameters for the circuit using 74HC04
squarewave then running that equivalent model on LTSpice n_mos p_mos simulation.
The picture of the circuit. and motional parameters that are adjusted to non-inverted 74HC04 so the current
looks ok but the voltage is rounded. The phase has improved.
16Mhz 18pF parameters.png
 

Bordodynov

Joined May 20, 2015
3,430
After running the numbers using best approximation for motional by Thompson formula
the result was a little better. Remember I am adjusting the parameters for the circuit using 74HC04
squarewave then running that equivalent model on LTSpice n_mos p_mos simulation.
The picture of the circuit. and motional parameters that are adjusted to non-inverted 74HC04 so the current
looks ok but the voltage is rounded. The phase has improved.
View attachment 330173
Are you by any chance using Multisim with its purely digital logic? Its logic cannot operate in amplifier mode. If so, you may be counting a lot of nonsense.
Many Multisim users have broken their teeth on modeling quartz oscillators. Models of logic elements on transistors are needed, as done in my Qspice. I also have many correct models of quartz oscillators. There are a lot of bad models in Multisim.
 
Top