AD8237 Spice Model doesn't work with OrCAD

I downloaded the spice model for AD8237 Instrumentation Amplifier from Analog Site and converted to a PSPICE model through a model editor. However, it's saying a sub-circuit is missing.

ERROR(ORPSIM-15108): Subcircuit AD8237 used by X_U1 is undefined. I have attached the image of the schematic and the full error file


**** 10/29/18 18:45:16 ******* PSpice Lite (March 2016) ******* ID# 10813 ****

** Profile: "SCHEMATIC1-ad8237_sim" [ c:\users\administrator\documents\training\cpe_621\project\simulations\ad8237_test-pspicefiles


**** CIRCUIT DESCRIPTION


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


** Creating circuit file "ad8237_sim.cir"
** WARNING: THIS AUTOMATICALLY GENERATED FILE MAY BE OVERWRITTEN BY SUBSEQUENT SIMULATIONS

*Libraries:
* Profile Libraries :
* Local Libraries :
* From [PSPICE NETLIST] section of C:\Users\Administrator\AppData\Roaming\SPB_Data\cdssetup\OrCAD_PSpice\17.2.0\PSpice.ini file:
.lib "nomd.lib"

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

**** INCLUDING SCHEMATIC1.net ****
* source AD8237_TEST
X_U1 0 N17832 0 0 N00203 N00210 N00199 VOUT AD8237
R_R1 N00199 N00210 1k TC=0,0
R_R2 VOUT N00199 399k TC=0,0
V_V6 N17832 0
+SIN 1.65 0.005 300 0 0 0
V_V7 N00203 0 3Vdc

**** RESUMING ad8237_sim.cir ****
.END

ERROR(ORPSIM-15108): Subcircuit AD8237 used by X_U1 is undefined

Parents
  • Hi,

    The message means that it can't find the "xxx.lib" file that has the AD8237 spice model in it.

    Rename the extension of spice model file you downloaded from the analog website Ex. ad8237.cir to ad8237.lib.

    Then in the schematic editor, under "analysis/library", look for the location where you save the ad8237.lib file and click add library.

    Hope this helps.

  • Thanks, I added the 
    AD8237_new.lib" file through PSpice->Edit Simulation->Configuration Files->Library->Add As Global

    Now I get the following Error, How can I fix it?

    ERROR(ORPSIM-16363): Command invalid in subcircuit

    My full Error file is shown below.


    **** 10/30/18 06:14:41 ******* PSpice Lite (March 2016) ******* ID# 10813 ****

    ** Profile: "SCHEMATIC1-ad8237_sim" [ c:\users\administrator\documents\training\cpe_621\project\simulations\ad8237_test-pspicefiles


    **** CIRCUIT DESCRIPTION


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


    ** Creating circuit file "ad8237_sim.cir"
    ** WARNING: THIS AUTOMATICALLY GENERATED FILE MAY BE OVERWRITTEN BY SUBSEQUENT SIMULATIONS

    *Libraries:
    * Profile Libraries :
    * Local Libraries :
    * From [PSPICE NETLIST] section of C:\Users\Administrator\AppData\Roaming\SPB_Data\cdssetup\OrCAD_PSpice\17.2.0\PSpice.ini file:
    .lib "C:\Cadence\SPB_17.2\tools\pspice\library\AD8237_new.lib"
    .lib "nomd.lib"

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

    **** INCLUDING SCHEMATIC1.net ****
    * source AD8237_TEST
    R_R1 N00199 N00210 1k TC=0,0
    R_R2 VOUT N00199 399k TC=0,0
    V_V6 N17832 0
    +SIN 1.65 0.005 300 0 0 0
    V_V7 N00203 0 3Vdc
    X_U1 0 N17832 0 0 N00203 N00210 N00199 VOUT AD8237

    **** RESUMING ad8237_sim.cir ****
    .END
    * Vh=0 which V hysteresis. When 0, SW will always be either completely ON or OFF
    * The Voltage across +/- controls the switch. In this case when BW_Mode=Von, the SW will close
    * When BW_Mode=Voff SW is OFF (or open) both C1&C2 will be on (BWHI)
    * HIBW set when both C1 & C2 are on
    S1 N020 N019 BW 0 SW
    .model SW Vswitch (Ron=1e-3 Roff=1e9 Von=-2.5 Voff=+2.5 Vh=0)
    * Adding High freq pole & zero
    * (G9)*R = DC value (1.2dB)
    * adding high freq poles (C7/R21) ~300kHz
    * adding high freq zero (C1/R28) ~120kHz
    G9 0 N013 sub_out 0 0.0023
    R21 N013 0 500
    C7 N013 0 2e-9
    R28 N019 Out_inp 10k
    * C8 & C10 set input cap. Cin=10pF for CM,Cin=5pF for Diff
    C8 IN- 0 10e-12
    C10 IN+ 0 10e-12
    * max Input Diff_volt = 1.1V from VDD
    E3 N010 V- VPOSX N007 1
    E4 V- N011 VPOSX N008 1
    D1 V+ N010 D
    D2 N011 V+ D
    V7 N007 VNEGX 1.6
    V8 N008 VNEGX 1.6
    * Vary Ibias with VCM
    G3 0 REF N027 N029 1.26e-9
    R8 FB N027 10e9
    R20 N027 REF 10e9
    G10 0 FB N027 N029 1.26e-9
    R2 +Vs N029 10e9
    R3 N029 -Vs 10e9
    * set the model of DIO
    .model D D
    *******
    .backanno
    $
    ERROR(ORPSIM-16363): Command invalid in subcircuit

    My schematic is shown below again

  • AD8237_Files.zip

    I may have zipped it wrong. You this file it should have all the files you need. Let me know if you can't find the files.

  • Hi,

    Please give us some time to verify this spice model.

    By the way, may I ask what particular application are you using AD8237?

  • I want to actually use it for a electromyogram (EMGs) application. I have seen the ECG circuit in the datasheet (last page) and I am really trying to simulate it. I want to know whether the same circuit could be used for EMGs (EMGs are around 20 Hz to 500Hz) and my previous design had a full wave rectifier and a envelop detector and I am trying to compare the performance between the two circuits before I do the PCB design.

  • Here's my other EMG circuit with a LPF, HPF, a precision rectifier and an envelope detector that  I am trying compare against ECG design in the datasheet. It has a OPAmp set to gain of 401 in place of the AD8237.

  • Hi,

    For the meantime, you could try using AD8420 which is almost similar to AD8237. Both are micropower instrumentation amplifiers used for ECG applications.

Reply Children
No Data