Upload
estella-barker
View
218
Download
3
Embed Size (px)
Citation preview
1
References:
G. W. Roberts, A. Sedra , SPICE, © Oxford University Press, 2/e, 1977
Tutorial on PSPICE
Introduction
SPICE = Simulation Program with Integrated Circuits Emphasis SPICE underlying engine solves numerically the various
continuous time differential equations describing the circuit How to use SPICE ? We have to write an input file, also called
“deck”.
Deck OutputSPICEEngine
ASCII ASCIIProgram
The SPICE deck
The input file must contain:
1. Title statement: always on the first line of the input file2. .END statement: always on the last line of the input file3. Circuit statements: lines that contains the description of a circuit element4. Control statements: lines that contains an analysis request or
measurements nodes or model parameters5. Comment statements: lines starting with an asterisk (*)
The order of the SPICE lines is not important except for the title line and the .END line SPICE is case insensitive and words can be separated by any number of spaces Components must be uniquely labeled Every node of the circuit is designated by a number. The ground node is labeled 0.
Example of an input file
Low Pass Filter
** Circuit Description Vin 1 0 PWL(0s, 0V, 1ms, 0V, + 1.0001ms, 1V) R1 1 2 1kohm C1 2 0 1uF
* Analysis Request .OP .TRAN 0.1ms 5ms
.end
Title
Positive Terminal
(n+)
Negative Terminal(n-)
.ENDcommand
The + sign means that
the previousstatement iscontinued on
this line.
Dimensions and scale-factors
Common circuit elementsFirst letter Element
C capacitor
D diode
R resistor
L inductor
Q bipolar transistor
M MOS Field Effect transistor
I independent current source
V independent voltage source
E voltage-controlled voltage source
F current-controlled current source
G voltage-controlled current source
H current-controlled voltage source
Independent Sources
Analysis and output requests
Besides the circuit description we need to:
Specify the type of analysis for our simulation Choose the circuit variables that we want to display
Analysis Requests
Operating point .OP
DC sweep .DC source_name start_value stop_value step_value
AC frequency response .AC DEC points_per_decade freq_start freq_stop
.AC OCT points_per_octave freq_start freq_stop
.AC LIN total_points freq_start freq_stop
Transient response .TRAN printing_time_step time_stop [time_start, max_time_step]
Output Requests
Sub circuits
The definition in SPICE for a subcircuit is as follow:.SUBCKT subcircuit_name list_of_nodes Circuit Description.ENDS
To incorporate the sub circuit into the main design
use the following statement, which starts with the
letter “X”:Xname node_connections subcircuit_name
Example using a sub circuit