Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Oscillator

Hello.

 

How can I test a 32.768KHz quartz crystal?

 

Can I use an oscillator circuit for that purpose? 

 

I tried using the following circuit:

http://www.eleccircuit.com/32768-khz-oscillator-using-a-watch-crystal/

I used the one with the inverter.

 

The problem is that before buying the real hardware components, I tried simulating the circuit using NI Multisim 11.0

The circuit is provided in the attachment file below.

 

 

Now my questions:

 

1) Should I use this method to test real quartz "tuning fork" crystals?

I mean, I only want to know if they are vibrating, and at what frequency (I don't require excellent ppm precison).

 

2) In the connector labeled "Out", shouldn't I obtain a 32.768KHz frequency?

 

3) It seems that for each TSTOP, TMAX and TSTEP I get different frequencies in the connector labeled "Out".

So, how can I determine what values should I use?

 

 

Thank you

lepton

0 Kudos
Message 1 of 10
(20,794 Views)

Anyone please...?

 

Thank you

lepton

0 Kudos
Message 2 of 10
(20,749 Views)

I was not able to simulate your circuit successfully. However, I have the following suggestions:

  1. Set TMAX to a fraction of the period of the clock
  2. Enable real pin models (Simulate>>Mixed-Mode Simulation Settings)
  3. Sometimes, changing the integration method to gear also helps (you've already done that in the custom simulation settings)

 

The circuit which you have drawn will work in real life. However, the recommended load and feedback values vary a little between each make and model so I would check with the datasheet to make sure.

 

----------
Yi
Software Developer
National Instruments - Electronics Workbench Group
Message 3 of 10
(20,733 Views)

lepton,

 

Here is a working circuit for a 32.768kHz crystal oscillator with an example on how to calculate values [C0crystal, C1crystal, R1crystal, L1crystal] for the crystal oscillator SPICE macro model.   When factoring in the impedance, the pin model on the input side of the digital gates is ~1pF and also the the package and pcb trace capacitance on both the input and output also needs to be taken into account for parallel resonance. 

 

The Multisim circuit has some details on the calculations and some references on good crystal oscillator source materials.

 

Hopefully this can help with your design efforts.

 

Regards,

Patrick Noonan

National Instruments

 

 

Message 4 of 10
(20,721 Views)

Hello yyao.

 

So you think my circuit will work?

 

OK, I'll buy the components and test the circuit (after all it's a very cheap circuit).

 

Hum...

I enabled real pin models

I changed the integration method to gear

 

Then in "Interactive Simulating Settings", I introduced the following values:

-Initial conditions - determine initial conditions

-TSTART=0

-TSTOP=10

-TMAX=1e-6s

-TSTEP=1e-7s

-Estimate max time step based on netlist TMAX=NO

 

Now it gives me 1.807KHz.   Smiley Sad

 

Maybe I did something wrong.

 

 

Thank you yyao

lepton

0 Kudos
Message 5 of 10
(20,664 Views)

Hello Patrick

 

Your circuit worked perfectly.

 

And if I replace your equivalent RLC circuit with a 32.768KHz crystal, it still works ok.

 

So I think your oscillator is better than mine. 🙂

I'll use it. 

 

Thank you Patrick

lepton

 

 

0 Kudos
Message 6 of 10
(20,661 Views)

Take a look at the design that Pat uploaded (32.768kHz Crystal - Equivalent Circuit Model.ms11). It has load capacitor and resistor values that are more commonly used in XTAL oscillators. If you don't have the datasheet for the oscillator that you are designing for, get a variety of values. Resistors and capacitors are cheep, so a variety of values in that order of magnitude can help debugging.

 

The thing with XTAL oscillators is, they work or they don't. Changing the load capacitors and resistors will only change the operating frequency by a few PPM. Don't connect your oscilloscope (or frequency counter) probe to the output of the oscillator directly. Your probe tip has (relatively) huge capacitances which may cause your oscillator to stop working (or even break). Instead, connect the output of your oscillator to another inverter on the 4069. This second inverter will act as a buffer. It is relatively harmless to measure the output of the second inverter. You should drive the remainder of your circuit with the second inverter too.

 

If you are using 4000 series CMOS, remember to ground unused inputs.

 

It is true that XTAL oscillators are quite sensitive. However, if you are careful, you can get by with breadboarding them.

----------
Yi
Software Developer
National Instruments - Electronics Workbench Group
0 Kudos
Message 7 of 10
(20,658 Views)

lepton,

 

I am glad you found the circuit useful.  Please let us know how the real circuit implementation operates.  

 

Also note that the circuit operation is highly dependent on the crystal model.  The model of the crystal is variable and based on 2 important things: the mfg (may use different L, R, C0, C1 - so look at the datasheet to come up with the correct model) and the Load Capacitance (C_load) which is used to as a parameter by the crystal mfg for the setting the correct design (and this varies based on the PCB and inverter used).

 

Good luck.

 

Regards,

Patrick Noonan

National Instruments

Message 8 of 10
(20,656 Views)

 I've tried everything to simulate a crystal oscillator but Multisim fails completely.

 

 These are known, working oscillator circuits:

 

http://www.national.com/an/AN/AN-400.pdf

 

  Now I know it's not me... 

Wow - not only does Multisim fail, but this forum software keeps prepending each line I type instead of appending it like any normal anything. I had to copy and paste because it made everything backwards. 

What is going on here? Gasp! I give up!

0 Kudos
Message 9 of 10
(20,301 Views)

Hi can anyone help me with the construction of a simple ppm (pulse position modulation) circuit in multisim ? Thanks a lot.

0 Kudos
Message 10 of 10
(19,983 Views)