home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker Chronicles 2
/
HACKER2.BIN
/
915.SPICEDEM.DOC
< prev
next >
Wrap
Text File
|
1987-12-05
|
10KB
|
260 lines
Introduction to Demo PSPICE
by Chuck Dorcey, College Park, MD, 20740.
08/Sept/1987.
This public-domain document attempts to introduce "educational" PSPICE to
those who have downloaded (or consider downloading) the archived files
PSPICE0, PSPICE1, and PSPICE2. After reading the comments below, one should
be able to decide whether this sort of CAD program will be useful, and hence
determine whether to buy the complete $40 manual from MicroSim Corporation.
First, a brief orientation:
SPICE is a computer program which simulates electronic circuits. This
simulation is performed at the "resistor-transistor" level, making it good
for analyzing logic gates, amplifiers, or active filters, for example, but
not so good for analyzing microprocessors (or even MSI digital ICs). As
noted in the "readme" file in PSPICE0.ARC, this version of SPICE ("Demo
PSPICE") is distributed by MicroSim Corporation for classroom use as an
introduction to their commercial PSPICE product. The complexity limit of
this version should be useful for many hobbyist applications as well.
Circuits to be simulated are described to SPICE in a text input file. Each
"node" in the circuit's schematic diagram must be numbered (by the user),
with components connecting the nodes. The circuit description can then be of
the form "<component name> <first node> <second node> [<other nodes>...]
<value>". The input file also contains simulation control commands, such as
".PRINT" and ".PLOT". See the example
below for details. Component types (resistor, capacitor, etc.) are
identified by the first character of their name; successive characters are
arbitrary (alphanumeric).
Componenents:
passive components:
Rxxxxxxx N1 N2 value [temperature coefficients]; resistor
Cxxxxxxx N1 N2 value [voltage coefficients]; capacitor
Lxxxxxxx L1 N2 value [current coefficients]; inductor
Kxxxxxxx Lxxxxxxx Lxxxxxxx value ; coupled inductors (transformer), both
inductors must be current independent.
Txxxxxxx N1 N2 N3 N4 Z0=value [Td=value]; transmission line
linear dependent sources:
Gxxxxxxx N+ N- NC+ NC- value; Voltage-Controlled Current Source (VCCS)
(value is transconductance, in mhos)
Exxxxxxx N+ N- NC+ NC- value; VCVS (value is voltage gain)
Fxxxxxxx N+ N- VNAM value; CCCS. VNAM is a voltage source through which the
controlling current flows. (value is current gain)
Hxxxxxxx N+ N- VNAM value; CCVS. (value is transresistance, in ohms)
independent sources:
Vxxxxxxx N+ N- [[DC] DC/TRAN VALUE] [AC [ACMAG [ACPHASE]]]
Ixxxxxxx ... (as above)
Time-dependent, independent sources are beyond the scope of this document.
semiconductors:
Dxxxxxxx N+ N- mname; junction diode
Qxxxxxxx NC NB NE mname; bipolar junction transistor
Jxxxxxxx ND NG NS mname; JFET transistor
Mxxxxxxx ND NG NS NB mname [W=VAL][L=VAL][AD=VAL][AS=VAL]; MOSFET, W and L
are channel width and length, in cm. AD and AS are drain and source
diffusion areas.
Device models are beyond the scope of this document.
The original EXAMPLE1.CIR file was entirely upper case; my comments are lower
case. These comments are based on a manual published in 1975 by the
University of California, Berkeley for the mainframe version of SPICE:
"SPICE2: A Computer Program to Simulate Semiconductor Circuits", by Laurence
W. Nagel. I assume all responsibility for erroneous or misleading
information in these annotations.
--------------------------------------------------------------------
EXAMPLE1 - AN ILLUSTRATION OF ALL COMMANDS
The first line of this (and all) input files is the title line (above).
It can contain anything.
*
* THIS CIRCUIT 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.
*
Any line which starts with an "*" is a comment.
.OPT ACCT LIST NODE OPTS NOPAGE RELTOL=.001
Control command lines start with ".". "OPT" specifies options, in this
case as listed below:
ACCT: display run-time accounting information.
LIST: print the input file in the output.
NODE: print the "node table" in the output.
OPTS: print the options in the output.
NOPAGE: suppress page-ejects in the output printout.
RELTOL: relative error tolerance = 0.001. (This is a relatively subtle
parameter controlling the numerical solution algorithm.)
(Additional options are described in the SPICE2 manual, but may not be
implemented in PSPICE.)
.WIDTH OUT=80
"OUT=80" is not described in my manual.
.TEMP 35
Simulate the circuit at 35 degrees C. My manual claims that
temperatures below -223 deg. C. are ignored, so don't expect superconductive
effects to be modeled!
.TF V(5) VIN
Evaluate the DC small-signal transfer function from Vin to V(5).
.DC VIN -0.25 0.25 0.005
Evaluate the DC transfer function for input values from -0.25 to 0.25 V
in 0.005 Volt steps.
.AC DEC 10 1 10GHZ
Evaluate the AC transfer function at 10 frequencies per decade, from 1
Hz to 10 GHz. (That is, at 10 frequencies between 1 Hz and 10 Hz, 10 more
between 10 Hz and 100 Hz, and so on.)
.TRAN/OP 5NS 500NS
Perform transient analysis, plotting output every 5 nanoseconds, for 500
ns. The "/OP" control is not described in my manual.
.SENS V(5)
Evaluate the DC small-signal sensitivity of the voltage at node 5 with
respect to every circuit parameter. (That is, if R1 changes by 1 ohm, how
much does V5 change? This is done for every circuit parameter, which may
produce large amounts of output.)
.NOISE V(5) VIN 20
Add noise to the input (Vin) and measure it at the output, for every
20th frequency point evaluated in AC analysis.
.FOUR 5MEG V(5)
Perform Fourier analysis. Inject a 5 MHz tone at the input, and monitor
V(5) for DC and the first 9 components. (Distortion may create spurious
output at 10 and 15 MHz, but not usually at, say, 7.5 MHz.)
Now we describe the circuit to be analyzed...
VIN 100 0 AC 1 SIN(0 0.1 5MEG)
Connect an independent voltage source named "VIN" between nodes 100 and
0 (Node 0 is reserved as "ground". Other node numbering is arbitrary. ).
The AC magnitude will be 1 Volt. Generate a sinusoidal wave with 0 volts DC
offset, 0.1 volt amplitude, and 5 MHz frequency. ( Delay (secs.) and damping
factor (1/secs.) are also described in my manual, in that order. )
VCC 101 0 DC 12
Connect an independent voltage source named "VCC" between nodes 101 and
0. It has a time-independent (DC) value of 12 volts.
VEE 102 0 -12
VEE is connected to node 102, and supplies -12 volts.
Q1 4 2 6 QNL
Transistor Q1 has its collector connected to node 4, its base to node 2,
and its emitter to node 6. It is described (below) in transistor model
"QNL".
Q2 5 3 6 QNL
RS1 100 2 1K
Resistor RS1 is connected between nodes 100 and 2, with a value of 1000
ohms.
RS2 3 0 1K
RC1 4 101 CRES 10K
Resistor RC1 is between nodes 4 and 101, has a value of 10 kohms, and is
further described in model CRES, below. ( My manual does not describe the
use of resistor models. )
RC2 5 101 CRES 10K
Q3 6 7 102 QNL
Q4 7 7 102 QNL
RBIAS 7 101 20K
( Note that the names of components are arbitrary, as long as the first
character identifies what kind of component it is. )
CLOAD 4 5 5PF
Capacitor "CLOAD" is between nodes 4 and 5, and has value 5 picoFarads.
.MODEL CRES RES (R=1 TC1=.02 TC2=.0045)
Define the resistor model "CRES" used above. Usage of "R=1" is not
described in my manual. TC1 and TC2 describe the variation in resistance
with temperature according to:
R(T) = R(Tnom) * (1 + TC1 * (T-Tnom) + TC2 * (T-Tnom)^2 );
where "^2" denotes "taken to the second power".
.MODEL QNL NPN (BF=80 RB=100 CCS=2PF TF=0.3NS TR=6NS CJE=3PF CJC=2PF
+ VA=50)
Define the transistor model "QNL" used above. Note the use of "+" in
first column to continue a command line.
QNL is an NPN transistor,
BF (forward current gain) = 80,
RB (base resistance) = 100 ohms,
CCS (collector to substrate capacitance) = 2 pF,
TF (forward transit time) = 0.3 nSec,
TR (reverse transit time) = 6 nSec,
CJE (zero-bias base-emitter junction ccapacitance) = 3 pF,
CJC (zero-bias base-collector junction capacitance) = 2 pF, and
VA (forward Early voltage) = 50 volts.
(This uses the "Gummel-Poon" model, if enought information is provided.
Otherwise, the "Ebers-Moll" model is used. Other parameters are described in
my manual. All have reasonable default values.)
.PRINT DC V(4) V(5)
Print the voltages calculated at nodes 4 and 5 during DC analysis. (Up
to 8 nodes could be specified. Use V(4,5) to print the difference between
the two nodes.)
.PLOT DC IC(Q2)
Though this isn't described in my manual, it seems to mean "plot the
collector current in Q2 during DC analysis".
.PRINT AC VM(5) VP(5)
Print the Magnitude and Phase of the complex voltage calculated for node
5.
.PLOT AC VCM(Q2) VCP(Q2)
The "VCM" and "VCP" parameters aren't described in my manual.
.PRINT NOISE INOISE ONOISE
Print input and output noise levels.
.PLOT NOISE INOISE ONOISE
Plot input and output noise.
.PRINT TRAN V(4) V(5)
Print voltages calculated at nodes 4 and 5 during transient analysis.
.PLOT TRAN V(4) V(5) I(CLOAD)
Plot the current through Cload, as well as the voltages above.
.END
This is always the last line in a SPICE input file.@ k@ ÇP ╟P ` `` Ü` ¡` ─` ╫` p p /p îæÿÉÿÿ0 ÿpÿ