home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / tech / pspce1-2 / example1.cir next >
Text File  |  1987-12-22  |  6KB  |  133 lines

  1. EXAMPLE1 - An Illustration of all Commands
  2. * This circuit, a differential pair, uses all possible commands to create
  3. * the maximum amount of output possible from such a small circuit.  Normally,
  4. * only a few kinds of output, such as transient analysis, would be run.
  5. * This command sets options for the run.
  6. .OPT ACCT LIST NODE OPTS NOPAGE RELTOL=.001
  7.  
  8. * Sets the width of the output to 80 columns.
  9. .WIDTH OUT=80
  10.  
  11. * Sets the temperature for the run to 35 degrees celsius.
  12. .TEMP 35
  13.  
  14. * This command does a DC sweep.  The voltage source VIN is swept from
  15. *   -0.25 volts to 0.25 volts in steps of 0.005 volts.  The non-linear
  16. *   device equations are used.
  17. .DC VIN -0.25 0.25 0.005
  18.  
  19. * There is no command to do a small-signal bias point calculation.  It
  20. *   is done automatically after the DC sweep is finished.  The non-linear
  21. *   device equations are used to find the bias point.  Then, the linearized,
  22. *   small-signal equivalent circuit at the bias point is saved for the .TF,
  23. *   .SENS, .AC, and .NOISE analysis.
  24.  
  25. * This command does a small-signal transfer function calculation assuming
  26. *   VIN is the input and V(5), the voltage at node 5, is the output.
  27. .TF V(5) VIN
  28.  
  29. * This does a sensitivity analysis of V(5) at the bias point with respect
  30. *   to the component values and model parameter values in the circuit.
  31. .SENS V(5)
  32.  
  33. * This does an AC analysis.  The real and imaginary response of the circuit
  34. *   is calculated as the inputs are swept from 1 hertz to 10 gigahertz by
  35. *   decades with 10 points per decade.  The only AC input this circuit has
  36. *   is VIN.  This is a linear analysis.
  37. .AC DEC 10 1 10GHZ
  38.  
  39. * This command does noise calculations during the AC analysis.  Each
  40. *   device's noise contribution is calculated and propogated to node 5.
  41. *   All the contributions are rms-summed at node 5.  Besides the total
  42. *   output noise printout done for every frequency, a detailed table of
  43. *   each device's contribution is done every 20'th frequency.
  44. .NOISE V(5) VIN 20
  45.  
  46. * This command does a transient analysis.  It first re-calculates the
  47. *   circuit's bias point, then calculates the circuit's time response
  48. *   from 0 nanoseconds to 500 nanoseconds using the full, non-linear device
  49. *   equations, including non-linear capacitances.  PSpice uses a variable
  50. *   time step for the calculations, but this command causes the results
  51. *   to be interpolated onto a 5 nanosecond print interval.  Transient
  52. *   analysis is the most frequently used analysis in PSpice.
  53. .TRAN/OP 5NS 500NS
  54.  
  55. * This does a harmonic decomposition on the waveform V(5) calculated
  56. *   during transient analysis.  It calculates the magnitude and phase
  57. *   of the fundamental (5 megahertz) and the first eight harmonics.
  58. .FOUR 5MEG V(5)
  59.  
  60. * This command does a Monte Carlo analysis of the circuit.  It runs
  61. *   transient analysis 5 times using the tolerances in .MODEL statements
  62. *   and compares the waveform V(5) from each run against the nominal
  63. *   V(5).  It then lists a table of each run's deviation from the 
  64. *   nominal.
  65. .MC 5 TRAN V(5) YMAX
  66.  
  67. * The following statements describe the circuit to PSpice.  It is a
  68. *   simple differential pair, with +12 and -12 volts as the supplies.
  69.  
  70. * VIN is the input for this circuit.  It has an amplitude during AC analysis
  71. *   of 1 volt and a sine waveform during transient of .1 volt at 5 megahertz.
  72. VIN 100 0 AC 1 SIN(0 0.1 5MEG)
  73.  
  74. * The power supplies are +12 volts and -12 volts.
  75. VCC 101 0 DC 12
  76. VEE 102 0 -12 
  77.  
  78. * The transistors' nodes are in the order collector - base - emitter.
  79. *   All transistors must refer to a model (QNL in this case).
  80. Q1 4 2 6 QNL
  81. Q2 5 3 6 QNL
  82.  
  83. * Models for resistors are optional.  If used they can specify such things
  84. *   as scaling, temperature coefficients, and tolerances.
  85. RS1 100 2 1K 
  86. RS2 3 0 1K
  87. RC1 4 101 CRES 10K
  88. RC2 5 101 CRES 10K
  89. Q3 6 7 102 QNL
  90. Q4 7 7 102 QNL
  91. RBIAS 7 101 20K
  92. CLOAD 4 5 5PF
  93.  
  94. * This statement describes the CRES resistor by giving the values for
  95. *   the parameters.  Each type of model has its own set of parameters.
  96. *   All parameters have default values.  In CRES we have set the scaling
  97. *   factor to 1, the linear temperature coefficient to .02, and the
  98. *   quadratic temperature coefficient to .0045, and given each resistor
  99. *   a 5% tolerance on its value during Monte Carlo analysis.
  100. .MODEL CRES RES (R=1 DEV=5% TC1=.02 TC2=.0045)
  101.  
  102. * The bipolar transistor model is the Gummel-Poon model.  It uses the
  103. *   same equations as in the UC Berkeley Spice program.  There are
  104. *   actually 55 model parameters, but most of these are for second-order
  105. *   effects that are rarely used.  Most bipolar models for realistic
  106. *   circuits specify between 12 and 25 parameters and default the rest.
  107. *   Here, we have set the forward beta to 80, the base resistance to
  108. *   100 ohms, the collector-substrate capacitance to 2 picofarads, the
  109. *   forward transit time to 0.3 nanoseconds, the reverse transit time to
  110. *   6 nanoseconds, the base-emitter capacitance to 3 picofarads, the
  111. *   base-collector capacitance to 2 picofarads, and the forward Early
  112. *   voltage to 50 volts.  The capacitances are actually voltage dependent.
  113. *   These numbers are the zero-bias values.
  114. .MODEL QNL NPN (BF=80 RB=100 CCS=2PF TF=0.3NS TR=6NS CJE=3PF CJC=2PF
  115. +   VA=50)
  116.  
  117. * These commands provide print and plot output for selected voltages
  118. *   and currents.  The plots are the so-called "line printer" plots.
  119. *   That is, plots made out of characters.  To get real, high-resolution
  120. *   plots you need to use Probe.
  121. .PRINT DC V(4) V(5)
  122. .PLOT DC IC(Q2) 
  123. .PRINT AC VM(5) VP(5) 
  124. .PLOT AC VCM(Q2) VCP(Q2)
  125. .PRINT NOISE INOISE ONOISE
  126. .PLOT NOISE INOISE ONOISE 
  127. .PRINT TRAN V(4) V(5)
  128. .PLOT TRAN V(4) V(5) I(CLOAD)
  129. *.PROBE
  130. .END
  131.