Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to simulate Crystal Oscillator in HSPICE?

Status
Not open for further replies.

jordan76

Full Member level 3
Joined
Mar 25, 2004
Messages
174
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
1,852
hspice oscillator

Does anyone have any idea about how to simulate crystal oscillator in HSPICE?

Any available spice model for crystal? Or do I have to create an equivalent spice model for it?

I heard it is very hard to simulate crystal oscillator in HSPICE,but some people did it successfully before. Could you share your experiences on it?

Thanks in advance!

regards,
jordan76
 

goodboy_pl

Full Member level 5
Joined
Mar 12, 2002
Messages
253
Helped
16
Reputation
32
Reaction score
15
Trophy points
1,298
Activity points
3,119
simulate crystal

XTAL is a mechanical device with several resonance frequency (and complicated behavior). it is possible and common to model it with RLC tank for a special resonance frequency, though this method does not model overtone modes it is usually sufficient if the model is available for the requred mode.

BEST!
 

Fom

Advanced Member level 2
Joined
Mar 10, 2004
Messages
633
Helped
84
Reputation
168
Reaction score
32
Trophy points
1,308
Location
Taiwan
Activity points
4,456
hspice .options oscillator
 

Rayengine

Full Member level 5
Joined
May 18, 2001
Messages
287
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Hong Kong
Activity points
1,737
crystal oscillator spice model

I also very interested in this topic. Crystal is a very complicated device in term of modelling. Is it possible to use only the L-R-C to model it?
 

ynhe

Full Member level 3
Joined
May 28, 2001
Messages
184
Helped
6
Reputation
12
Reaction score
2
Trophy points
1,298
Location
China
Activity points
1,344
how to simulate crystal oscillator

Hi
see INTUSOFT's model library for Generic Crystals spice model.
This crystal may be used in oscillator and filter applications. The
parameters that are passed to it are the frequency of oscillation
(FREQ), Q of the crystal (Q), series resistance (RS) and the
parallel capacitance (CP). By specifying the proper parameters,
virtually any crystal may be simulated.
Example: XOSC 1 2 XTAL {Q=10K RS=10 CP=20PF
+ FREQ=10KHZ}
X2 1 2 XT10


ynhe
 

fun.zhao

Member level 1
Joined
Mar 29, 2004
Messages
41
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
332
crystal osc hspice

I suggest you simulating Crystal Oscillator by ADS or Spectre (PSS &PNOISE)
Because HSPICE can't simulate Phase Noise
ADS has PC edition.
 

jordan76

Full Member level 3
Joined
Mar 25, 2004
Messages
174
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
1,852
crystal oscillator transient simulation

Thanks for the promt reply!

I just found in HSPICE manual the following:
For circuits with very high resonance factors(such as crystal tank circuits,and active filters), .OPTION DELMAX should be set to less than period/100.

Share with you!

(Other conservative simulation options also should be used in crystal simulation as mentioned by Fom's post.)

regards,
jordan76
 

tucura

Junior Member level 2
Joined
Jun 19, 2002
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
143
pss resonant frequency of oscillator

It is possible to do a spice transient simulation of a crystal
oscillator by setting options, time varying the Q using ideal
switches, or using initial conditions, but simulation results will be
useless unless simulation time is extended by several thousand
cycles, far more than practical. Energy can not be put or taken
out of a high Q tank. ADS uses harmonic resonance methods,
and that makes possible to simulate several K cycles.
 

ysz

Member level 2
Joined
Aug 14, 2004
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
fujian china
Activity points
442
crystal simulation hspice option

MY SIM FILE:
vdd vdd gnd pwl(0u 0v 5000u 3v)
.option post=2
.tran 1u 200000u
.lib 'MYLIB.lib' tt

MP2 OSC2 OSC1 VDD VDD PCH L=2U W=400U
MN2 OSC2 OSC1 0 0 NCH L=2U W=200U

RF OSC1 OSC2 15000K

R1 OSC1 N1N13 30K
C1 N1N13 N1N55 0.003P
L1 N1N55 OSC2 7863H
CO OSC1 OSC2 1.5P

CL2 OSC2 0 8P
CL1 OSC1 0 8P
.END

IT HAS CORRECT FREQ, BUT VPP ONLY 1MV, WHO CAN HELP ME?
 

Humungus

Full Member level 6
Joined
Jul 10, 2001
Messages
384
Helped
41
Reputation
82
Reaction score
15
Trophy points
1,298
Activity points
3,985
spice model crystal transiente

Set a reasonable initial condiction
 

ysz

Member level 2
Joined
Aug 14, 2004
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
fujian china
Activity points
442
oscillator hspice

Humungus said:
Set a reasonable initial condiction

What is reasonable initial conditions? Could you help me to sim the file? tks.
 

tlihu

Full Member level 6
Joined
Jan 2, 2002
Messages
336
Helped
19
Reputation
42
Reaction score
13
Trophy points
1,298
Activity points
2,258
hspice crystal

Do I need to set ".OPTION METHOD=GEAR"?
 

jordan76

Full Member level 3
Joined
Mar 25, 2004
Messages
174
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
1,852
crystal oscillator simulation in spice

Maybe you can try to make power ramp rate smaller. say about 100ns.

Good luck!
jordan76
 

Hughes

Advanced Member level 3
Joined
Jun 10, 2003
Messages
717
Helped
113
Reputation
226
Reaction score
25
Trophy points
1,298
Activity points
5,984
hspice simulator conservative

ysz said:
MY SIM FILE:
vdd vdd gnd pwl(0u 0v 5000u 3v)
.option post=2
.tran 1u 200000u
.lib 'MYLIB.lib' tt

MP2 OSC2 OSC1 VDD VDD PCH L=2U W=400U
MN2 OSC2 OSC1 0 0 NCH L=2U W=200U

RF OSC1 OSC2 15000K

R1 OSC1 N1N13 30K
C1 N1N13 N1N55 0.003P
L1 N1N55 OSC2 7863H
CO OSC1 OSC2 1.5P

CL2 OSC2 0 8P
CL1 OSC1 0 8P
.END

IT HAS CORRECT FREQ, BUT VPP ONLY 1MV, WHO CAN HELP ME?

You may try to use a smaller step value in transient analysis, 100ns for example.
 

r23718

Newbie level 4
Joined
Sep 1, 2004
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
71
crystal library pspice

changing 1u to 100n in .tran 1u 200000u
will not help - it is "initial" sep size. Simulator will then change step size to anything. It is a good idea to limit step size in case you do not see any oscillation. This could be done by setting option (usually) maxstep=100n which obviously sets max step allowed.
If there IS a small oscillation then you need to wait for building it up - run overnight. To speed up startup you can initial current through L in its netlist definition Ic=1u - this will kick it up. Or you can set voltage on both L ends bu .IC (perhaps VCC/2). If oscillation dies you do not have good one. If it continues it will still take a long time to settle to its natural freq.
 

Susie1004

Newbie level 1
Joined
Sep 1, 2004
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
8
crystal oscillator rmax

U can try to use the .IC statement to set transient inital conditions.
 

Hughes

Advanced Member level 3
Joined
Jun 10, 2003
Messages
717
Helped
113
Reputation
226
Reaction score
25
Trophy points
1,298
Activity points
5,984
crystal oscillator site:edaboard.com

r23718 said:
changing 1u to 100n in .tran 1u 200000u
will not help - it is "initial" sep size. Simulator will then change step size to anything.

Maybe you are right. But I have ever heard someone encountered the same problem -- the output swing is too small. He finally solved the problem by changing the transient step size to 0.1ns.
I don't know why.
 

ysz

Member level 2
Joined
Aug 14, 2004
Messages
44
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
fujian china
Activity points
442
crystal hspice model

r23718 said:
changing 1u to 100n in .tran 1u 200000u
will not help - it is "initial" sep size. Simulator will then change step size to anything. It is a good idea to limit step size in case you do not see any oscillation. This could be done by setting option (usually) maxstep=100n which obviously sets max step allowed.
If there IS a small oscillation then you need to wait for building it up - run overnight. To speed up startup you can initial current through L in its netlist definition Ic=1u - this will kick it up. Or you can set voltage on both L ends bu .IC (perhaps VCC/2). If oscillation dies you do not have good one. If it continues it will still take a long time to settle to its natural freq.
Accuracy and DELMAX
For maximum accuracy, .OPTION DELMAX should be set to (period/100). For
circuits with very high resonance factors (high Q circuits such as crystal
oscillators, tank circuits, and active filters) DELMAX should be set to less than (period/100).
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top