Professional Documents
Culture Documents
PSPICE Tutorial: The University of Texas at Arlington July 22 2010
PSPICE Tutorial: The University of Texas at Arlington July 22 2010
Ankit G Doshi
The University of Texas at Arlington
July 22nd 2010
Introduction
• http://www.cadence.com/products/orcad/p
ages/downloads.aspx
How to type in the given circuit
TITLE STATEMENT
ELEMENT STATEMENTS
.
.
COMMAND (CONTROL) STATEMENTS
OUTPUT STATEMENTS
.END <CR>
Scale Factors
• Examples:
– Vin 2 0 DC 10
– Is 3 4 DC 1.5
Dependent Sources
• Voltage controlled voltage source: Ename N1 N2 NC1 NC2 Value
• Voltage controlled current source: Gname N1 N2 NC1 NC2 Value
• Current controlled voltage source: Hname N1 N2 Vcontrol Value
• Current controlled current source: Fname N1 N2 Vcontrol Value
– N1 and N2 are the positive and negative terminals of the dependent source, respectively.
– NC1 and NC2 are the positive and negative terminals of the controlling voltage source,
respectively.
– Vcontrol is the zero value voltage source used to measure the controlling current (the
positive current flows into the positive terminal of the controlling voltage source!).
• Example:
– Ebar 17 8 42 18 24.0 (VCVS)
– Glab 23 17 8 3 2.5 (VCIS)
– Hvx 20 12 Vhx 50.0 (CCVS)
Vhx 80 76 DC 0V ; controls Hvx
– Ftrn 81 19 Vctl 50.0 (CCCS)
Vclt 23 12 DC 0V ; controls Ftrn
Resistors, Capacitors and Inductors
• Resistor: Rname N1 N2 Value
• Capacitor: Cname N1 N2 Value <IC>
• Inductor: Lname N1 N2 Value <IC>
• Example:
– Rin 3 4 100k
– Cc 7 8 20f 5
– L3 2 0 6.25m 1m
Sinusoidal Sources
• Sinusoidal Voltage Source: Vname N1 N2 SIN(VO VA FREQ TD THETA PHASE)
• To generate a cosine function, you can make use of the phase relationship between the sinusoid
and cosine. Here is an example of an undelayed cosine with an amplitude of 5V and frequency of
50 Hz.
– Vcos 1 2 SIN(0 5 50 0 0 90)
Piecewise Linear Sources (PWL)
– in which (Ti Vi) specifies the value Vi of the source at time Ti
• Example:
– Vgpwl 1 2 PWL(0 0 10U 5 100U 5 110U 0)
Transformers
Example transformer
VIN 2 0 SIN(0 170 60 0 0)
* This defines a sinusoid of 170
*amplitude and 60 Hz.
RS 2 1 10
L1 1 0 2000
L2 3 0 20
K L1 L2 0.99999
.TRAN 0.2M 25M
.PLOT TRAN V(2)
.PLOT TRAN V(3)
.END
Subcircuits
• A subcircuit allows you to define a collection of elements as a subcircuit (e.g. an
operational amplifier) and to insert this description into the overall circuit (as you would
do for any other element).
• It is a kind of function or subroutine in C.
• Defining a subcircuit
• A subcircuit is defined by a .SUBCKT control statement, followed by the circuit
description as follows:
• in which SUBNAME is the subcircuit name and N1, N2, N3 are the external nodes of
the subcircuit. The external nodes cannot be 0. The node numbers used inside the
subcircuit are strictly local, except for node 0 which is always global.
Subcircuits (Cont.)
• D: Diode
• NPN: npn bipolar transistor
• PNP: pnp bipolar transistor
• NMOS: nmos transistor
• PMOS: pmos transistor
• NJF: N-channel JFET model
• PJF: P-channel JFET model
Semiconductor Devices (Cont.)
• Diode
– Element line: Dname N+ N- MODName
– Model Statement: .MODEL MODName D (IS= N= Rs= CJO= Tt= BV= IBV=)
Example:
D1 5 3 D1N4148
.model D1N4148 D (IS=0.1PA, RS=16 CJO=2PF TT=12N BV=100 IBV=0.1PA)
Semiconductor Devices (Cont.)
• BJT
– Element Line: Qname C B E BJT_modelName
– Model statement: .MODEL BJT_modName NPN (BF=val IS=val VAF=val)
Example:
Q3 4 2 0 Q2N2222A
.model Q2N2222A NPN (IS=14.34F XTI=3 EG=1.11 VAF= 74.03 BF=255.9 +
NE=1.307 ISE=14.34F IKF=.2847 XTB=1.5 BR=6.092 NC=2 ISC=0 IKR=0 +
RC=1 CJC=7.306P MJC=.3416 VJC=.75 FC=.5 CJE=22.01P MJE=.377 +
VJE=.75 TR=46.91N TF=411.1P ITF=.6 VTF=1.7 XTF=3 RB=10)
Semiconductor Devices (Cont.)
• MOSFET
– Element Line: Mname ND NG NS <NB> ModName L= W=
– Model statement: .MODEL ModName NMOS (KP= VT0= lambda= gamma=)
Example:
M5 4 2 0CMOSN
.model CMOSN NMOS (LEVEL=3 PHI=0.600000 TOX=2.1200E-08 XJ=0.200000U
+TPG=1 VTO=0.7860 DELTA=6.9670E-01 LD=1.6470E-07 KP=9.6379E-05
+UO=591.7 THETA=8.1220E-02 RSH=8.5450E+01 GAMMA=0.5863
+NSUB=2.7470E+16 NFS=1.98E+12 VMAX=1.7330E+05 ETA=4.3680E-02
+KAPPA=1.3960E-01 CGDO=4.0241E-10 CGSO=4.0241E-10
+CGBO=3.6144E-10 CJ=3.8541E-04 MJ=1.1854 CJSW=1.3940E-10
+MJSW=0.125195 PB=0.800000)
2. Control Statements
– In which LIN stands for a linear frequency variation, DEC and OCT for a
decade and octave variation respectively.
– NP stands for the number of points and ND and NO for the number of
frequency points per decade and octave.
– FSTART and FSTOP are the start and stopping frequencies in Hertz
• It generates is a plot.
• Format: .PROBE
– When using .PROBE statement as output,
after successfully simulating the netlist a
blank graph is generated. User has to
manually insert traces of interest to see the
graph.
Example 1
Example 1 (Cont.)
EXAMPLE Pspice TITLE Line
VIN 1 0 DC 10
F1 0 3 VMEAS 0.5 |
VMEAS 4 0 DC 0 |
R1 1 2 1K |
R2 2 3 10K |DATA
R3 1 3 15K |
R4 2 4 40K |
R5 3 0 50K
.OP
.TF V(3,0) VIN |CONTROL
.DC VIN 0 20 2
.PRINT DC V(1,2) V(2,4) I(VMEAS) OUTPUT
.PROBE OUTPUT
.END END Statement
Example 2
Example 2 (Cont.)
Full wave rectifier power supply
Vin 5 0 SIN(0 170 60)
* Transformer
L1 6 0 330
L2 1 0 3
K L1 L2 0.99999
RS 5 6 0.1
*Bridge
D1 2 1 diode
D2 2 0 diode
D3 1 3 diode
D4 0 3 diode
R 3 4 98
C 3 2 425u
RL 4 2 450
D 2 4 mod1
.TRAN 0.2m 10
.PROBE
.END
References