Вы находитесь на странице: 1из 41

PSPICE

A brief primer
By

Ramprasad Panda
Associate Professor
Department of Electrical & Electronics Engineering
Silicon Institute of Technology

INTRODUCTION
SPICE is a powerful general purpose analog
and mixed-mode circuit simulator that is used
to verify circuit designs and to predict the
circuit behavior
This is of particular importance for integrated
circuits.
SPICE was originally developed at the
Electronics Research Laboratory of the
University of California, Berkeley (1975)
SPICE stands for Simulation Program for
Integrated Circuits Emphasis.

PSpice is a PC version of SPICE (which is


currently available from OrCAD Corp. of
Cadence Design Systems, Inc.)
A student version (with limited capabilities)
comes with various textbooks. The OrCAD
student edition is called PSpice AD Lite
Information about Pspice AD is available from
the
OrCAD
website:
http://www.orcad.com/pspicead.aspx
The PSpice Light version has the following
limitations: circuits have a maximum of 64
nodes, 10 transistors and 2 operational
amplifiers.

SPICE can do several types of circuit


analyses
Non-linear DC analysis: calculates the DC
transfer curve.
Non-linear transient and Fourier analysis:
calculates the voltage and current as a function
of time when a large signal is applied; Fourier
analysis gives the frequency spectrum.
Linear AC Analysis: calculates the output as a
function of frequency. A bode plot is generated.
Noise analysis
Parametric analysis
Monte Carlo Analysis

PSpice has analog and digital libraries of


standard components
NAND
NOR
flip-flops
MUXes
FPGA
PLDs and
many more digital components
This makes it a useful tool for a wide range of
analog and digital applications.
(All analyses can be done at different temperatures. The
default temperature is 300K. )

The circuit can contain the following


components:

Independent and dependent voltage and current sources


Resistors
Capacitors
Inductors
Mutual inductors
Transmission lines
Operational amplifiers
Switches
Diodes
Bipolar transistors
MOS transistors
JFET
MESFET
Digital gates
and other components (see users manual).

PSpice with OrCAD Capture (release 9.2


edition)

Step 1: Circuit Creation with Capture

1.
2.
3.
4.

Create a new Analog, mixed AD project


Place circuit parts
Connect the parts
Specify values and names

Step 2: Specify type of simulation

1.
2.

Create a simulation profile


Select type of analysis: o Bias, DC sweep, Transient, AC sweep

3.

Run PSpice

Step 3: View the results


1. Add traces to the probe window
2.
3.
4.

Use cursors to analyze waveforms


Check the output file, if needed
Save or print the results

The values can be specified using


scaling factors (upper or lower case)
T or Tera (= 1E12)
G or Giga (= E9)
MEG or Mega (= E6)
K or Kilo (= E3)
M or Milli (= E-3)
U or Micro (= E-6)
N or Nano (= E-9)
P or Pico (= E-12)
F of Femto (= E-15)

How to Create a new project?


1.
2.
3.
4.
5.
6.

Open OrCAD Capture


Create a new Project: FILE
MENU/NEW_PROJECT
Enter the name of the project
Select Analog or Mixed-AD
When the Create PSpice Project box
opens, select "Create Blank Project".

A new page will open in the Project Design


Manager as shown below.

Place the components and connect the


parts
1.
2.

Click on the Schematic window in Capture.


To Place a part go to PLACE/PART menu or click on the
Place Part Icon. This will open a dialog box shown
below.

After placing all part, you need to place the Ground terminal
by clicking on the GND icon (on the left side toolbar).

Specifying the type of analysis and


simulation

BIAS or DC analysis
DC Sweep simulation
Transient Analysis
AC Sweep Analysis
Parametric Sweep

Example of the Bias simulation displayed


on the schematic
R1
10.00V

10k
20.00V
V1

R2

20v

I1
0Adc

0V

C1
5u

10k

DC Sweep simulation
1.
2.

3.

Create a new Simulation Profile (from the PSpice Menu)


For analysis select DC Sweep; enter the name of the voltage source to be swept:
V1. The start and end values and the step need to be specified: 0, 20 and 0.1V,
respectively (see Fig. below).
Run the simulation. PSpice will generate an output file that contains the values of
all voltages and currents in the circuit.

Displaying the simulation Results


PSpice has a user-friendly interface to show the results of the
simulations. Once the simulation is finished a Probe window
will open.

From the TRACE menu select ADD TRACE and select the voltages and current you
like to display. In our case we'll add V(out) and V(in). Click OK.

Result of the DC sweep, showing Vout, Vin

Transient Analysis

We'll be using the same circuit as for the DC sweep, except that we'll apply the
voltage and current sources by closing a switch,

1. Insert the SW_TCLOSE switch from the EVAL


Library as shown above.
2. Double click on the switch TCLOSE value and enter
the value when the switch closes. Lets make
TCLOSE = 5 ms.
3. Set up the Transient Analysis: go to the
PSPICE/NEW SIMULATION PROFILE.
4. Give it a name (e.g. Transient). When the Simulation
Settings window opens, select "Time Domain
(Transient)" Analysis. Enter also the Run Time. Lets
make it 50 ms. For the Max Step size, you can leave
it blank or enter 10us.
5. Run PSpice.

Results of the transient simulation

Circuit with a sinusoidal input.

AC Sweep Analysis
Create a new project and build the circuit
For the voltage source use VAC from the
Sources library.
Make the amplitude of the input source 1V.
Create a Simulation Profile. In the Simulation
Settings window, select AC Sweep/Noise.
Enter the start and end frequencies and the
number of points per decade. For our example
we use 0.1Hz, 10 kHz and 11, respectively.
Run the simulation

Circuit for the AC sweep simulation.

Simulation using Spice programming


1. Like any other language spice programming can be
used to simulate a digital, analog or mixed circuit
2. All the programming are based on nodal analysis
3. Like in schematic or capture all type of analysis can
be done in spice programming
4. Typical syntaxes are to be used in programming
5. All the simulations are to be done in Pspice A/D
6. The programme is to be written in text file & is to be
saved as circuit file before simulation

DC Circuit Analysis
Types of output
1.
.Print (print Statement)
2.
.Plot (Plot Statement)
3.
.Probe (probe Statement)
4.
.WIDTH (Width Statement)
Type of DC analysis
1.
.OP (Operating point)
2.
.TF (Small-Signal Transfer Function)
3.
.DC (DC sweep)
4.
.PARAM ( DC parametric Sweep)

Example of DC analysis

Plotting of output characteristics of a JFET


VX

3
0Vdc

J1

VDD
VGS

J105

0Vdc

R1
50

12V

Programming
*GATE TO SOURCE VOLTAGE OF 0 VOLTS
VGS 1 0 DC 0V
VX 3 2 DC 0V
VDD 3 0 DC 12V
J1 2 1 4 JMOD
R1 4 0 50
.MODEL JMOD NJF (IS=100E-14 RD=10 RS=10
+BETA=1E-3 VTO=-5)
.DC VDD 0 12 0.2 VGS 0 -4 1
.PLOT DC I(R1)
.PROBE
.END

Output Characteristics

Operating Point or Bias Point


Finding node voltages &currents
*SIMPLE DC CIRCUIT
VS 1 0 DC 20V
IS 0 4 DC 50MA
R1 1 2 500
1
R2 2 5 800
R3 2 3 1KOHM
20V
R4 4 0 200
VX 3 0 DC 0V
VY 5 4 DC 0V
.OP
.END

R1

R2

500

800

VY

0Vdc

R3
VS

1k
VX

0Vdc

IS
R4
200

50M

Output File
SIMPLE DC CIRCUIT

****

SMALL SIGNAL BIAS SOLUTION

TEMPERATURE = 27.000 DEG C

******************************************************************************

NODE VOLTAGE

1) 20.0000 (

5) 10.5000

NODE VOLTAGE

2) 12.5000 (

3)

VOLTAGE SOURCE CURRENTS


NAME
CURRENT

VS
VX
VY

-1.500E-02
1.250E-02
2.500E-03

NODE VOLTAGE

0.0000 (

4) 10.5000

NODE VOLTAGE

Simulation result in capture

R1

15.00mA
500

20V

VY

12.50V2.500mA 2.500mA
800
0Vdc
12.50mA
R3

20.00V
VS

R2

1k
VX
12.50mA

10.50V
52.50mA
R4
200

0Vdc
15.00mA

0V

IS
50M
50.00mA

Example for Transient analysis

Transient response of a CMOS Inverter


2

M3

PM OS
1

3
VDD

M1
5V

NM OS
VIN

RL
100K

Programming
*CMOS INVERTER
VDD 2 0 5V
VIN 1 0 DC 5V PULSE (0 5V 0 1NS 1NS 20US 40US)
RL 3 0 100K
M1 3 1 2 2 PMOD L=1U W=20U
.MODEL PMOD PMOS (VTO=-2 KP=4.5E-4 CBD=5PF CBS=2PF RD=5
RS=2 +RB=0 RG=0 RDS=1MEG CGSO=1PF CGDO=1PF CGBO=1PF)
M2 3 1 0 0 NMOD L=1U W=5U
.MODEL NMOD NMOS (VTO=2 KP=4.5E-5 CBD=5PF CBS=2PF RD=5
RS=2 +RB=0 RG=0 RDS=1MEG CGSO=1PF CGDO=1PF CGBO=1PF)
.TRAN 1US 80US
.TF V(3) VIN
.PLOT TRAN V(3) V(1)
.OP
.PROBE
.END

Simulation Results

Example for AC Sweep

Transient & frequency response of a BJT


amplifier
7
R1

410K

47K

R1

C1

RC

Q1

C2
1UF

RL

V1

20K
500

1U

MM3905
R2

VIN

CE

RE
5K

15V

2K

10UF

Programming
*frequency & transient response of a transistor amplifier
VIN 1 0 AC 10MV SIN(0 10MV 1KHZ)
VCC 0 7 DC 15V
RS 1 2 500
R1 7 3 47K
R2 3 0 5K
RC 7 4 10K
RE 5 0 2K
RL 6 0 20K
C1 2 3 1UF
C2 4 6 1UF
CE 5 0 10UF
Q1 4 3 5 0 QM
.MODEL QM PNP(IS=2E-16 BF=100 BR=1 RB=5 RC=1 RE=0 TF=0.2NS TR=5NS CJE=0.4PF
VJE=0.8 ME=0.4 CJC=0.5PF VJC=0.8 CCS=1PF VA=100)
.PLOT TRAN V(4) v(6) V(1)
.PLOT AC VM(6) VP(6)
.OPTIONS NOPAGE NOECHO
.TRAN/OP 50US 2MS
.AC DEC 10 1HZ 10KHZ
.OP
.PROBE
.END

Transient response

Frequency response

References
1. OrCAD website for PSpice
(http://www.orcad.com/pspicead.aspx), has application notes,
download, examples and interesting links.
2. OrCAD website for CAPTURE.
(http://www.orcad.com/orcadcapture.aspx)
3. PSpice Users manual, OrCAD Corp. (Cadence Design
Systems, Inc.)
4. PSpice Reference Guide, OrCAD Corp. (Cadence Design
Systems, Inc.)
5. PSpice Library Guide, OrCAD Capture User's Guide,
(Cadence Design Systems, Inc.)
6. OrCAD Capture Users Guide, OrCAD Corp., (Cadence
Design Systems, Inc.)
7. SPICE Tutorial, http://www.seas.upenn.edu/~jan/spice/
8. A. Vladimirescu, The Spice Book, J. Wiley & Sons, New
York, 1994.
9. B. Carter, "Using Texas Instruments Spice Models in
PSpice, Application Report, SLOA070, Texas Instruments,

Вам также может понравиться