home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1
/
HamRadio.cdr
/
tech
/
pspce1-2
/
example1.cir
next >
Wrap
Text File
|
1987-12-22
|
6KB
|
133 lines
EXAMPLE1 - An Illustration of all Commands
*
* This circuit, a differential pair, uses all possible commands to create
* the maximum amount of output possible from such a small circuit. Normally,
* only a few kinds of output, such as transient analysis, would be run.
*
* This command sets options for the run.
.OPT ACCT LIST NODE OPTS NOPAGE RELTOL=.001
* Sets the width of the output to 80 columns.
.WIDTH OUT=80
* Sets the temperature for the run to 35 degrees celsius.
.TEMP 35
* This command does a DC sweep. The voltage source VIN is swept from
* -0.25 volts to 0.25 volts in steps of 0.005 volts. The non-linear
* device equations are used.
.DC VIN -0.25 0.25 0.005
* There is no command to do a small-signal bias point calculation. It
* is done automatically after the DC sweep is finished. The non-linear
* device equations are used to find the bias point. Then, the linearized,
* small-signal equivalent circuit at the bias point is saved for the .TF,
* .SENS, .AC, and .NOISE analysis.
* This command does a small-signal transfer function calculation assuming
* VIN is the input and V(5), the voltage at node 5, is the output.
.TF V(5) VIN
* This does a sensitivity analysis of V(5) at the bias point with respect
* to the component values and model parameter values in the circuit.
.SENS V(5)
* This does an AC analysis. The real and imaginary response of the circuit
* is calculated as the inputs are swept from 1 hertz to 10 gigahertz by
* decades with 10 points per decade. The only AC input this circuit has
* is VIN. This is a linear analysis.
.AC DEC 10 1 10GHZ
* This command does noise calculations during the AC analysis. Each
* device's noise contribution is calculated and propogated to node 5.
* All the contributions are rms-summed at node 5. Besides the total
* output noise printout done for every frequency, a detailed table of
* each device's contribution is done every 20'th frequency.
.NOISE V(5) VIN 20
* This command does a transient analysis. It first re-calculates the
* circuit's bias point, then calculates the circuit's time response
* from 0 nanoseconds to 500 nanoseconds using the full, non-linear device
* equations, including non-linear capacitances. PSpice uses a variable
* time step for the calculations, but this command causes the results
* to be interpolated onto a 5 nanosecond print interval. Transient
* analysis is the most frequently used analysis in PSpice.
.TRAN/OP 5NS 500NS
* This does a harmonic decomposition on the waveform V(5) calculated
* during transient analysis. It calculates the magnitude and phase
* of the fundamental (5 megahertz) and the first eight harmonics.
.FOUR 5MEG V(5)
* This command does a Monte Carlo analysis of the circuit. It runs
* transient analysis 5 times using the tolerances in .MODEL statements
* and compares the waveform V(5) from each run against the nominal
* V(5). It then lists a table of each run's deviation from the
* nominal.
.MC 5 TRAN V(5) YMAX
* The following statements describe the circuit to PSpice. It is a
* simple differential pair, with +12 and -12 volts as the supplies.
* VIN is the input for this circuit. It has an amplitude during AC analysis
* of 1 volt and a sine waveform during transient of .1 volt at 5 megahertz.
VIN 100 0 AC 1 SIN(0 0.1 5MEG)
* The power supplies are +12 volts and -12 volts.
VCC 101 0 DC 12
VEE 102 0 -12
* The transistors' nodes are in the order collector - base - emitter.
* All transistors must refer to a model (QNL in this case).
Q1 4 2 6 QNL
Q2 5 3 6 QNL
* Models for resistors are optional. If used they can specify such things
* as scaling, temperature coefficients, and tolerances.
RS1 100 2 1K
RS2 3 0 1K
RC1 4 101 CRES 10K
RC2 5 101 CRES 10K
Q3 6 7 102 QNL
Q4 7 7 102 QNL
RBIAS 7 101 20K
CLOAD 4 5 5PF
* This statement describes the CRES resistor by giving the values for
* the parameters. Each type of model has its own set of parameters.
* All parameters have default values. In CRES we have set the scaling
* factor to 1, the linear temperature coefficient to .02, and the
* quadratic temperature coefficient to .0045, and given each resistor
* a 5% tolerance on its value during Monte Carlo analysis.
.MODEL CRES RES (R=1 DEV=5% TC1=.02 TC2=.0045)
* The bipolar transistor model is the Gummel-Poon model. It uses the
* same equations as in the UC Berkeley Spice program. There are
* actually 55 model parameters, but most of these are for second-order
* effects that are rarely used. Most bipolar models for realistic
* circuits specify between 12 and 25 parameters and default the rest.
* Here, we have set the forward beta to 80, the base resistance to
* 100 ohms, the collector-substrate capacitance to 2 picofarads, the
* forward transit time to 0.3 nanoseconds, the reverse transit time to
* 6 nanoseconds, the base-emitter capacitance to 3 picofarads, the
* base-collector capacitance to 2 picofarads, and the forward Early
* voltage to 50 volts. The capacitances are actually voltage dependent.
* These numbers are the zero-bias values.
.MODEL QNL NPN (BF=80 RB=100 CCS=2PF TF=0.3NS TR=6NS CJE=3PF CJC=2PF
+ VA=50)
* These commands provide print and plot output for selected voltages
* and currents. The plots are the so-called "line printer" plots.
* That is, plots made out of characters. To get real, high-resolution
* plots you need to use Probe.
.PRINT DC V(4) V(5)
.PLOT DC IC(Q2)
.PRINT AC VM(5) VP(5)
.PLOT AC VCM(Q2) VCP(Q2)
.PRINT NOISE INOISE ONOISE
.PLOT NOISE INOISE ONOISE
.PRINT TRAN V(4) V(5)
.PLOT TRAN V(4) V(5) I(CLOAD)
*.PROBE
.END