Because of the Thanksgiving holiday in the U.S., TI E2E™ design support forum responses may be delayed from November 25 through December 2. Thank you for your patience.

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Circuit simulation with Pspice

Hi there
I have a circuit to be simulated in Pspice.
I'm a complete newbie to it, but have so far managed to create the schematic with the help of tutorials. I'm posting the schematic that I currently have.

I have added the libraries for the the components to my design by editing the simulation profile but even then I get errors that the sub circuits used by the AD8336 component are undefined (although the .cir file for the AD8336 contains definitions for the sub circuits as well). Similar errors come up in case of AD736. I'm clue less as to why the same library file does not cater to the sub circuit definitions as well. As of now there is no error in the input signal generator. Please help. I shall be highly grateful to you :)

P.S: I'm including the .cir files for the AD8336 and AD736 below and also the errors that show up in the system log when I try running the simulation.

---------------------------------------------------------------------AD8336.cir---------------------------------------------------------------------------------------------

.SUBCKT AD8336 GNEG GPOS INPN INPP PRAO PWRA VCOM VGAI VNEG VOUT VPOS
E_U4_E8 VPBUF 0 TABLE { V(VPOS, 0) }
+ ( (0,0)(2.8,0)(3.0,1.6)(5,3.6)(12,10.6)(15,13.6))uselim
E_U4_E9 VNBUF 0 TABLE { V(VNEG, 0) }
+ ( (-15,-13.6)(-12,-10.6)(-5,-3.6)(-3.0,-1.6)(-2.8,0)(0,0))uselim
X_U4_D5 PRAO VPBUF DC_1mV_1A_1V_1nA
C_U4_C3 0 U4_S3 1n
R_U4_R4 0 INPP 450K
C_U4_C5 0 U4_N24227 2.5p
E_U4_E7 U4_N254725 0 VALUE {V(U4_N349891,0)*V(POK,0)}
R_U4_R6 0 INPN 450k
X_U4_D15 VNBUF U4_S3 GEN_DIODE
C_U4_C1 INPN PRAO 2p
X_U4_D13 U4_S3 VPBUF GEN_DIODE
G_U4_G4 0 U4_N24227 U4_S3 0 1
C_U4_C4 INPN 0 6p
X_U4_D6 VNBUF PRAO DC_1mV_1A_1V_1nA
X_U4_S1 PWRAL 0 U4_N254725 U4_S3 PrA_U4_S1
E_U4_E6 U4_N349891 0 INPP INPN 1.0
C_U4_C2 INPP 0 6p
G_U4_G3 U4_N24227 PRAO TABLE { V(U4_N24227, PRAO) }
+ ( (-15,-60m)(-1m,-50m)(0,0)(1m,50m)(15,60m) )uselim
G_U2_G8 VNEG 0 PWRAL 0 11m
X_U2_U12 VNEG U2_N958367 COMPARATOR2 PARAMS: TH=-2.8
R_U2_R14 0 VNEG 50K
R_U2_R11 0 VPOS 50K
G_U2_G6 VNEG 0 POK 0 14m
X_U2_U16 U2_N968984 POK PWRAL AND
X_U2_U14 U2_N958933 U2_N958855 POK AND
R_U2_R13 0 VNEG 50K
V_U2_V1 U2_AGAINDB1 U2_AGAINDB2 12.04
G_U2_G3 0 U2_AGAINDB1 TABLE { V(VGN, VCOM) }
+ (
+ (-1.0,-14.0)(-0.7,-14.0)(-0.6,-12.5)(-0.52,-9.3)(0.0,17.0)(0.2,27.0)(0.4,37.0)(0.5,42.0)(0.6,46.0)(1.0,46.0)
+ )uselim
X_U2_D13 GPOS VPOS GEN_DIODE
R_U2_R8 0 U2_AGAINDB1 1
E_U2_E1 VGN 0 GPOS GNEG 1
X_U2_U15 U2_N967091 PWRA U2_N968984 COMPARATOR
G_U2_G7 VPOS 0 PWRAL 0 11m
X_U2_U13 U2_N958367 U2_N958855 INVERTER
E_U2_ABM1 AGAIN 0 VALUE { (10**(V(U2_AGAINDB2)/20))*V(POK) }
R_U2_R12 0 VPOS 50K
C_U2_C5 0 U2_AGAINDB1 20n
X_U2_U11 VPOS U2_N958933 COMPARATOR2 PARAMS: TH=2.8
G_U2_G5 VPOS 0 POK 0 14m
X_U2_D14 VNEG GNEG GEN_DIODE
E_U2_E2 U2_N967091 0 TABLE { V(VPOS, 0) }
+ ( (0,0)(3,0.7) (5,1.2)(12,3.2) )uselim
X_U2_D16 GNEG VPOS GEN_DIODE
X_U2_D15 VNEG GPOS GEN_DIODE
E_U3_E8 U3_CMOUT U3_N55982 VCOM 0 1
E_U3_ABM1 U3_N62113 0 VALUE { MIN(PWR(V(AGAIN),1),1.6) }
E_U3_E7 U3_N55982 0 TABLE { V(VGN, 0) }
+ (
+ (-0.7,-2m)(-0.6,-4m)(-0.5,-8m)(-0.45,-10m)(-0.4,-14m)(-0.35,-15m)(-0.3,-11m)(-0.25,-9m)(-0.2,-11m)(-0.1,-22m)(0.0,-25m)(0.1,-16m)
+ (0.2,-19m)(0.3,-32m)(0.4,-52m)(0.5,-80m)(0.6,-120m)(0.65,-128m)(0.7,-127m) )uselim
E_U3_ABM2 U3_N61993 0 VALUE { (V(U3_RIN)-V(U3_ROUT))/nonzero(V(U3_N62113)) }
G_U3_G3 U3_N48981 U3_N48971 TABLE { V(U3_N48981, U3_N48971) }
+ ( (-15,-75m)(-1m,-64.8m)(0,0)(1m,64.8m)(15,75m) )uselim
X_U3_D16 U3_N48949 VPBUF GEN_DIODE
C_U3_C4 U3_N249674 0 1n
E_U3_E3 U3_N249442 0 U3_N48949 0 1
G_U3_G5 U3_RIN U3_ROUT U3_N61993 0 1
E_U3_E4 U3_RIN 0 VALUE {V(VGAI,0)*V(AGAIN,0)}np
X_U3_D7 VNBUF VOUT DC_1mV_1A_1V_1nA
E_U3_E2 U3_N48981 U3_CMOUT U3_N249674 0 1
R_U3_R15 U3_N249442 U3_N249674 0.1
X_U3_D18 VNBUF VGAI GEN_DIODE
X_U3_D6 VOUT VPBUF DC_1mV_1A_1V_1nA
X_U3_D17 VGAI VPBUF GEN_DIODE
X_U3_S1 PWRAL 0 U3_ROUT U3_N48949 VGA_U3_S1
R_U3_R14 U3_N48971 VOUT 2.5
X_U3_D15 VNBUF U3_N48949 GEN_DIODE
C_U3_C3 0 U3_N48949 1n
.ENDS

.subckt PrA_U4_S1 1 2 3 4
S_U4_S1 3 4 1 2 _U4_S1
RS_U4_S1 1 2 1G
.MODEL _U4_S1 VSWITCH Roff=200 Ron=100 Voff=0.25V Von=0.75V
.ends PrA_U4_S1

.subckt VGA_U3_S1 1 2 3 4
S_U3_S1 3 4 1 2 _U3_S1
RS_U3_S1 1 2 1G
.MODEL _U3_S1 VSWITCH Roff=10 Ron=.001 Voff=0.25V Von=0.75V
.ends VGA_U3_S1

.subckt GEN_DIODE 1 2
D1 1 2 DI2D
.model DI2D D Is=1e-14 Cjo=.1pF Rs=.1
.ends GEN_DIODE

.subckt DC_1mV_1A_1V_1nA A C
G1 A C TABLE { V(A, C) } ( (-1,-1n)(0,0)(1m,1) (2m,10) (3m,1000) )
.ends DC_1mV_1A_1V_1nA

.SUBCKT COMPARATOR2 INP OUT
+ PARAMs: TH=1
EOUT OUT 0 VALUE { IF( V(INP)>TH,1,0) }
.ends COMPARATOR2

.SUBCKT AND A B OUT
EOUT OUT 0 VALUE { IF( V(A)>0.5 & V(B)>0.5,1,0) }
.ends AND

.SUBCKT INVERTER IN OUT
EOUT OUT 0 VALUE { IF( V(IN)<0.5,1,0) }
.ends INVERTER

.SUBCKT COMPARATOR INP INM OUT
EOUT OUT 0 VALUE { IF( V(INP)>V(INM),1,0) }
.ends COMPARATOR

---------------------------------------------------------------------AD736.cir-------------------------------------------------------------------------------------------
$
.SUBCKT AD736 CC VIN CF NVS COM VS VOUT CAV
* Use .OPTIONS GMIN=5E-17 for best output accuracy
R1 18 13 8K
R3 18 1 4K
R4 1 15 3K
Q1 VS 4 15 NPN
.MODEL NPN NPN
R90 6 13 3K
GB3 COM CAV VALUE={I(V4)*I(V4)}
R5 10 NVS 8K
V5 CAV 10
X3 CF COM 16 VS NVS AEIOPAMP0
R7 CF 16 8K
R8 CC 19 8K
*R11 19 0 1G
R10 16 VOUT 0.2
GB2 VIN 0 VALUE={1P + 50P*V(VIN)}
Q7 VS 4 6 NPN
V4 13 COM
X1 1 COM 4 VS NVS AEIOPAMP1
GB4 19 0 VALUE={1P + 15P*V(CC)}
GB1 CF COM VALUE={SQRT(I(V5))}
EB5 18 0 VALUE={IF(ABS(V(VIN)) >=ABS(V(CC)), V(VIN) , V(CC))}
.ENDS
*$
.SUBCKT AEIOPAMP0 2 3 6 7 4
RP 4 7 10K
IB 3 90 1.0000N
VIB 90 4
IO 3 2 2.5000N
RIP 3 4 1G
CIP 3 4 1.4PF
FIBN 2 4 VIB 1
RIN 2 4 1G
CIN 2 4 1.4PF
VOFST 2 10 10.0000N
RID 10 3 1G
EA 11 4 10 3 1
R1 11 12 5K
R2 12 13 50K
C1 12 4 130.00F
GA 4 14 4 13 270.00
C2 13 14 27.000F
RO 14 4A 75
EBAL 4A 4 2A 4 1
RBAL1 7 2A 1MEG
RBAL2 2A 4 1MEG
L 14 6 300.00N
RL 14 6 1000
CL 6 4 3PF
D1 6 70 DN
VSAT 70 7 -2.0600
D2 40 6 DN
VSAT2 40 4 2.0600
.MODEL DN D
.ENDS
*$
.SUBCKT AEIOPAMP1 2 3 6 7 4
RP 4 7 10K
IB 3 90 5.0000N
VIB 90 4
IO 3 2 500.00P
RIP 3 4 1G
CIP 3 4 1.4PF
FIBN 2 4 VIB 1
RIN 2 4 1G
CIN 2 4 1.4PF
VOFST 2 10 10.0000N
RID 10 3 1G
EA 11 4 10 3 1
R1 11 12 5K
R2 12 13 50K
C1 12 4 65.000F
GA 4 14 4 13 135.00
C2 13 14 13.500F
RO 14 4A 75
EBAL 4A 4 2A 4 1
RBAL1 7 2A 1MEG
RBAL2 2A 4 1MEG
L 14 6 150.00N
RL 14 6 1000
CL 6 4 3PF
D1 6 70 DN
VSAT 70 7 -1.0000
D2 40 6 DN
VSAT2 40 4 1.0000
.MODEL DN D
.ENDS
*$

------------------------------------------------------------------------------Errors--------------------------------------------------------------------------------------

*Libraries:
* Profile Libraries :
* Local Libraries :
.LIB "C:/OrCAD/OrCAD_16.6_Lite/tools/pspice/library/ad736.lib"
.LIB "C:/OrCAD/OrCAD_16.6_Lite/tools/pspice/library/ad8551.lib"
.LIB "C:/OrCAD/OrCAD_16.6_Lite/tools/pspice/library/ad8336.lib"
* From [PSPICE NETLIST] section of C:\Users\Sakshi_Project_staff\AppData\Roaming\SPB_16.6\cdssetup\OrCAD_PSpice/16.6.0/PSpice.ini fi
.lib "nomd.lib"

*Analysis directives:
.TRAN 0 10ms 0
.OPTIONS ADVCONV
.PROBE64 V(alias(*)) I(alias(*)) W(alias(*)) D(alias(*)) NOISE(alias(*))
.INC "..\SCHEMATIC1.net"



**** INCLUDING SCHEMATIC1.net ****
* source AGC_SIM
V_V5 N13626 GND 5Vdc
X_U1 N13234 N13194 N13510 GND N13478 GND GND N13478 N13910 N133221
+ N13784 AD8336
R_R4 GND N13194 1k TC=0,0
C_C9 GND N13330 4.7n TC=0,0
R_R6 N13258 N13290 10k TC=0,0
X_U2 GND N13590 N15826 N13578 GND N13626 N13290 N13310 AD736
V_V3 N13784 GND 5Vdc
V_V1 GND N13030 5Vdc
R_R7 N133221 N13330 100 TC=0,0
C_C3 GND N13082 0.1u TC=0,0
C_C5 N13234 N13258 0.022u TC=0,0
V_V6 GND N13578 -5Vdc
R_R5 N13230 N13258 10k TC=0,0
C_C11 N13510 N13478 1n TC=0,0
C_C1 GND N13030 0.1u TC=0,0
R_R10 N13510 N13478 1k TC=0,0
C_C6 N13578 N13310 33u TC=0,0
V_V4 GND N13672 5Vdc
R_R1 N13118 N13082 9.09k TC=0,0
R_R9 N13768 N13510 1k TC=0,0
X_U3 N13672 N13234 GND N13258 N13648 AD8551
R_R3 N13194 N13082 1k TC=0,0
C_C4 N13230 N13234 2.2u TC=0,0
R_R11 GND N13590 1Meg TC=0,0
C_C7 N13330 OUTPUT 10u TC=0,0
C_C10 N13590 OUTPUT 0.1u TC=0,0
R_R13 N13118 N13648 500 TC=0,0
V_V2 N13910 GND -5Vdc
R_R12 GND N13648 500 TC=0,0
C_C12 N15826 N13290 10u TC=0,0
V_V9 N13768 GND AC 5V
+SIN 0V 5V 50 0 0 0

**** RESUMING "AGC Analysis.cir" ****
.END


**** EXPANSION OF SUBCIRCUIT X_U1 ****
X_U1.E_U4_E8 X_U1.VPBUF 0 TABLE { V(10#, 0) } 0 0 2.8 0 3.0 1.6 5 3.6
+ 12 10.6 15 13.6 uselim
------------------$
ERROR(ORPSIM-16152): Invalid number
$
ERROR(ORPSIM-16049): Values must be monotonic increasing

+ E_U4_E9 VNBUF 0 TABLE { V(8#, 0) } -15 -13.6 -12 -10.6 -5 -3.6 -3.0
+ -1.6 -2.8 0 0 0 uselim
X_U1.X_U4_D5 N13478 X_U1.VPBUF DC_1mV_1A_1V_1nA
X_U1.C_U4_C3 0 X_U1.U4_S3 1n
X_U1.R_U4_R4 0 GND 450K
X_U1.C_U4_C5 0 X_U1.U4_N24227 2.5p
X_U1.E_U4_E7 X_U1.U4_N254725 0 VALUE {V(U4_N349891,0)*V(POK,0)}
X_U1.R_U4_R6 0 N13510 450k
X_U1.X_U4_D15 X_U1.VNBUF X_U1.U4_S3 GEN_DIODE
X_U1.C_U4_C1 N13510 N13478 2p
X_U1.X_U4_D13 X_U1.U4_S3 X_U1.VPBUF GEN_DIODE
X_U1.G_U4_G4 0 X_U1.U4_N24227 X_U1.U4_S3 0 1
X_U1.C_U4_C4 N13510 0 6p
X_U1.X_U4_D6 X_U1.VNBUF N13478 DC_1mV_1A_1V_1nA
X_U1.X_U4_S1 X_U1.PWRAL 0 X_U1.U4_N254725 X_U1.U4_S3 PrA_U4_S1
X_U1.E_U4_E6 X_U1.U4_N349891 0 GND N13510 1.0
X_U1.C_U4_C2 GND 0 6p
X_U1.G_U4_G3 X_U1.U4_N24227 N13478 TABLE { V(U4_N24227, 4#) } -15
+ -60m -1m -50m 0 0 1m 50m 15 60m uselim
----------------------------------$
ERROR(ORPSIM-16152): Invalid number
$
ERROR(ORPSIM-16049): Values must be monotonic increasing

+ G_U2_G8 8 0 PWRAL 0 11m
X_U1.X_U2_U12 PARAMS X_U2_U12.TH -2.8 N13910 X_U1.U2_N958367
+ COMPARATOR2
X_U1.R_U2_R14 0 N13910 50K
X_U1.R_U2_R11 0 N13784 50K
X_U1.G_U2_G6 N13910 0 X_U1.POK 0 14m
X_U1.X_U2_U16 X_U1.U2_N968984 X_U1.POK X_U1.PWRAL AND
X_U1.X_U2_U14 X_U1.U2_N958933 X_U1.U2_N958855 X_U1.POK AND
X_U1.R_U2_R13 0 N13910 50K
X_U1.V_U2_V1 X_U1.U2_AGAINDB1 X_U1.U2_AGAINDB2 12.04
X_U1.G_U2_G3 0 X_U1.U2_AGAINDB1 TABLE { V(VGN, 6#) } -1.0 -14.0 -0.7
+ -14.0 -0.6 -12.5 -0.52 -9.3 0.0 17.0 0.2 27.0 0.4 37.0 0.5 42.0 0.6
+ 46.0 1.0 46.0 uselim
----------------$
ERROR(ORPSIM-16152): Invalid number
$
ERROR(ORPSIM-16049): Values must be monotonic increasing

+ X_U2_D13 1 10 GEN_DIODE
X_U1.R_U2_R8 0 X_U1.U2_AGAINDB1 1
X_U1.E_U2_E1 X_U1.VGN 0 N13194 N13234 1
X_U1.X_U2_U15 X_U1.U2_N967091 GND X_U1.U2_N968984 COMPARATOR
X_U1.G_U2_G7 N13784 0 X_U1.PWRAL 0 11m
X_U1.X_U2_U13 X_U1.U2_N958367 X_U1.U2_N958855 INVERTER
X_U1.E_U2_ABM1 X_U1.AGAIN 0 VALUE { (10**(V(U2_AGAINDB2)/20))*V(POK)
+ }
X_U1.R_U2_R12 0 N13784 50K
X_U1.C_U2_C5 0 X_U1.U2_AGAINDB1 20n
X_U1.X_U2_U11 PARAMS X_U2_U11.TH 2.8 N13784 X_U1.U2_N958933
+ COMPARATOR2
X_U1.G_U2_G5 N13784 0 X_U1.POK 0 14m
X_U1.X_U2_D14 N13910 N13234 GEN_DIODE
X_U1.E_U2_E2 X_U1.U2_N967091 0 TABLE { V(10#, 0) } 0 0 3 0.7 5 1.2 12
+ 3.2 uselim
------$
ERROR(ORPSIM-16152): Invalid number
$
ERROR(ORPSIM-16049): Values must be monotonic increasing

+ X_U2_D16 0 10 GEN_DIODE
X_U1.X_U2_D15 N13910 N13194 GEN_DIODE
X_U1.E_U3_E8 X_U1.U3_CMOUT X_U1.U3_N55982 GND 0 1
X_U1.E_U3_ABM1 X_U1.U3_N62113 0 VALUE { MIN(PWR(V(AGAIN),1),1.6) }
X_U1.E_U3_E7 X_U1.U3_N55982 0 TABLE { V(VGN, 0) } -0.7 -2m -0.6 -4m
+ -0.5 -8m -0.45 -10m -0.4 -14m -0.35 -15m -0.3 -11m -0.25 -9m -0.2
+ -11m -0.1 -22m 0.0 -25m 0.1 -16m 0.2 -19m 0.3 -32m 0.4 -52m 0.5
+ -80m 0.6 -120m 0.65 -128m 0.7 -127m uselim
--------------------------------------$
ERROR(ORPSIM-16152): Invalid number
$
ERROR(ORPSIM-16049): Values must be monotonic increasing
+ E_U3_ABM2 U3_N61993 0 VALUE { (V(U3_RIN)-V(U3_ROUT))/nonzero(V(U3_N62113))
+ }
X_U1.G_U3_G3 X_U1.U3_N48981 X_U1.U3_N48971 TABLE { V(U3_N48981, U3_N48971)
+ } -15 -75m -1m -64.8m 0 0 1m 64.8m 15 75m uselim
--------------------------------------------$
ERROR(ORPSIM-16152): Invalid number
$
ERROR(ORPSIM-16049): Values must be monotonic increasing

ERROR(ORPSIM-15108): Subcircuit DC_1mV_1A_1V_1nA used by X_U1.X_U4_D5 is undefined

ERROR(ORPSIM-15108): Subcircuit GEN_DIODE used by X_U1.X_U4_D15 is undefined

ERROR(ORPSIM-15108): Subcircuit GEN_DIODE used by X_U1.X_U4_D13 is undefined

ERROR(ORPSIM-15108): Subcircuit DC_1mV_1A_1V_1nA used by X_U1.X_U4_D6 is undefined

ERROR(ORPSIM-15108): Subcircuit PrA_U4_S1 used by X_U1.X_U4_S1 is undefined

ERROR(ORPSIM-15108): Subcircuit COMPARATOR2 used by X_U1.X_U2_U12 is undefined

ERROR(ORPSIM-15108): Subcircuit AND used by X_U1.X_U2_U16 is undefined

ERROR(ORPSIM-15108): Subcircuit AND used by X_U1.X_U2_U14 is undefined

ERROR(ORPSIM-15108): Subcircuit COMPARATOR used by X_U1.X_U2_U15 is undefined

ERROR(ORPSIM-15108): Subcircuit INVERTER used by X_U1.X_U2_U13 is undefined

ERROR(ORPSIM-15108): Subcircuit COMPARATOR2 used by X_U1.X_U2_U11 is undefined

ERROR(ORPSIM-15108): Subcircuit GEN_DIODE used by X_U1.X_U2_D14 is undefined

ERROR(ORPSIM-15108): Subcircuit GEN_DIODE used by X_U1.X_U2_D15 is undefined

ERROR(ORPSIM-15108): Subcircuit DC_1mV_1A_1V_1nA used by X_U1.X_U3_D7 is undefined

ERROR(ORPSIM-15108): Subcircuit GEN_DIODE used by X_U1.X_U3_D18 is undefined

ERROR(ORPSIM-15108): Subcircuit DC_1mV_1A_1V_1nA used by X_U1.X_U3_D6 is undefined

ERROR(ORPSIM-15108): Subcircuit GEN_DIODE used by X_U1.X_U3_D17 is undefined

ERROR(ORPSIM-15108): Subcircuit VGA_U3_S1 used by X_U1.X_U3_S1 is undefined

ERROR(ORPSIM-15108): Subcircuit GEN_DIODE used by X_U1.X_U3_D15 is undefined

ERROR(ORPSIM-15108): Subcircuit AEIOPAMP0 used by X_U2.X3 is undefined

ERROR(ORPSIM-15108): Subcircuit AEIOPAMP1 used by X_U2.X1 is undefined

  • Sakshi,

    Did you associate the model to your symbol? How were the symbols created for the devices that you are using? PSpice requires a pin mapping from the .lib file to the symbol pins. You can do this using the model editor to create the .olb file that will contain the actual referenced symbol for the device.

    I am also concerned that there are numbers with hashes (#) in the expansion of the expressions. These should be voltages at the nodes that are connected to these pins of the device.

    Since none of these devices are TI devices, you may want to contact Analog Devices for help and instruction on how to use their models.