Browse Source
update to XSPICE phase-locked loop example
update to XSPICE phase-locked loop example
9 changed files with 161 additions and 30 deletions
-
32examples/xspice/pll/README
-
50examples/xspice/pll/loop-filter-2.cir
-
2examples/xspice/pll/loop-filter.cir
-
18examples/xspice/pll/pll-xspice-fstep.cir
-
31examples/xspice/pll/pll-xspice.cir
-
13examples/xspice/pll/test-f-p-det.cir
-
10examples/xspice/pll/test_vco.cir
-
5examples/xspice/pll/vco_sub.cir
-
30examples/xspice/pll/vco_sub_new.cir
@ -0,0 +1,50 @@ |
|||||
|
* loop filter for pll |
||||
|
* in: d_up d_down digital data |
||||
|
* out: vout, vco control voltage |
||||
|
* using transistors to switch current |
||||
|
* according to http://www.uwe-kerwien.de/pll/pll-schleifenfilter.htm |
||||
|
* digital input d_Un d_D |
||||
|
* anlog output vout |
||||
|
|
||||
|
|
||||
|
.subckt loopf d_Un d_D vout |
||||
|
|
||||
|
.param initcond=2.5 |
||||
|
|
||||
|
vdd dd 0 dc 'vcc' |
||||
|
vss ss 0 dc 0 |
||||
|
|
||||
|
* "driver" circuit, digital in, analog out |
||||
|
abridge-f1 [d_Un d_D] [u1n d1] dac1 |
||||
|
.model dac1 dac_bridge(out_low = 0 out_high = 'vcc' out_undef = 'vcc/2' |
||||
|
+ input_load = 5.0e-12 t_rise = 1e-10 |
||||
|
+ t_fall = 1e-10) |
||||
|
|
||||
|
* uses BSIM3 model parameters from pll-xspice_2.cir |
||||
|
* transistors as switches |
||||
|
mnd dra d1 ss ss n1 w=12u l=0.35u AS=24p AD=24p PS=28u PD=28u |
||||
|
mpd dra u1n dd dd p1 w=24u l=0.35u AS=48p AD=48p PS=52u PD=52u |
||||
|
|
||||
|
*** passive filter elements *** |
||||
|
*third order filter |
||||
|
*parameters absolutely _not_ optimised |
||||
|
*better check |
||||
|
* http://www.national.com/assets/en/boards/deansbook4.pdf |
||||
|
*to do so |
||||
|
.ic v(vout)='initcond' v(c1)='initcond' v(dra)='initcond' v(int1)='initcond' v(u1n)='vcc' v(d1)=0 |
||||
|
R1 dra int1 300 |
||||
|
R2 int1 c1 200 |
||||
|
C1 c1 0 10n |
||||
|
C2 int1 0 5n |
||||
|
R3 int1 vout 50 |
||||
|
C3 vout 0 0.5n |
||||
|
|
||||
|
*second order filter |
||||
|
*parameters not optimized |
||||
|
*.ic v(vout)='initcond' v(c1)='initcond' v(dra)='initcond' v(u1n)='vcc' v(d1)=0 |
||||
|
*R1 dra vout 300 |
||||
|
*R2 vout c1 200 |
||||
|
*C1 c1 0 10n |
||||
|
*C2 vout 0 5n |
||||
|
|
||||
|
.ends loopf |
||||
@ -0,0 +1,30 @@ |
|||||
|
***** XSPICE digital controlled oscillator d_osc as vco *************** |
||||
|
* 150 MHz to 900 MHz |
||||
|
* name: d_osc_vco |
||||
|
* aout analog out |
||||
|
* dout digital out |
||||
|
* cont control voltage |
||||
|
* dd supply voltage |
||||
|
|
||||
|
.subckt d_osc_vco aout dout cont dd |
||||
|
* curve fitting to ro_vco 'measured' data |
||||
|
Bfit fitted 0 v = (-58256685.71*v(cont)*v(cont) - 186386142.9*v(cont) + 988722980)/10. |
||||
|
|
||||
|
*a5 fitted dout var_clock |
||||
|
*.model var_clock d_osc(cntl_array = [1.0e7 5.0e7 9.0e7] |
||||
|
*+ freq_array = [1.0e8 5.0e8 9.0e8] |
||||
|
|
||||
|
* linear interpolation, input data from measured ro vco |
||||
|
a5 cont dout var_clock |
||||
|
.model var_clock d_osc(cntl_array = [0.5 1 1.5 2 2.5] |
||||
|
+ freq_array = [8.790820e+008 7.472197e+008 5.799500e+008 3.772727e+008 1.611650e+008] |
||||
|
+ duty_cycle = 0.5 init_phase = 180.0 |
||||
|
+ rise_delay = 1e-10 fall_delay=1e-10) |
||||
|
|
||||
|
*generate an analog output for plotting |
||||
|
abridge-fit [dout] [aout] dac1 |
||||
|
.model dac1 dac_bridge(out_low = 0 out_high = 1 out_undef = 0.5 |
||||
|
+ input_load = 5.0e-12 t_rise = 1e-10 |
||||
|
+ t_fall = 1e-10) |
||||
|
|
||||
|
.ends d_osc_vco |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue