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.

INA225: PSPICE model error when trying to simulate

Part Number: INA225


Tool/software:

Hi,

I tried to use the PSPICE model within LTspice (yeah I know TI tech support is not keen on supporting this) and I get the following error when I try to do a simple transient simulation. 

Fatal Error: u1:_u16:g1:
-- Syntax Error --
v(u1:_u16:nsw)*(v(n006,u1:inn)/ 1000000 «)}»

u1 is the instance of INA255 in my simulation. I tried searching for a statement like this in the model file, but I couldn't find. 

Any ideas?

Has anyone able to simulate this SPICE model using LTSpice? 

Cheers,

Kaushalya

  • Hi Kaushalya,

    Could you share a screenshot of your model set up please.

    Best,
    Mallika Senthil

  • Hi Mallika,

    Thanks for looking into this. 

    I am not sure what you mean by model setup. I have added the error and the symbol settings.

    Symbol

    Cheers,

    Kaushalya

  • Hi Kaushalya,

    I have a couple of suggestions:

    1. Try adding a ground to your current source (I1), generally our models requires the common mode side to be referenced to ground.

    2. If that doesn't work, check if the model is encrypted, if it is, request the unencrypted version

    3. If it still doesn't work, then maybe LTSpice does not support the model syntax. The recommendation then would be to install PSpice for TI. 

    Best,
    Mallika Senthil

  • Hi Mallika,

    1. I tried adding a GND to IN-, but did not solve the error

    2. I am sure it is no encrypted as if so, I wouldn't be able to create the LTSpice model.

    3. I tried using PSPICE for TI, but it failed too. I just opened up the project and run the simulation. Following are what I see in the output  window.

    --------------- INFO(ORPROBE-3209): Simulation Profile:  INA225_TRANS_AC-INA225_AC_TRANS ---------------
    INFO(ORPROBE-3183): Simulation running...
    ** Profile: "INA225_TRANS_AC-INA225_AC_TRANS"  [ C:\Projects\SIM\INA225_PSPICE_AIO\ina225-pspicefiles\ina225_trans_ac\ina225_ac_tran
    Reading and checking circuit
    WARNING(ORPSIM-15246): Library index file ina225.ind does not have the correct format
    INFO(ORPSIM-15422): Making new index file ina225.ind for library file ina225.lib.
    Making index file for library C:\Projects\SIM\INA225_PSPICE_AIO\ina225.lib
    Please be patient. This may take several minutes...
    ERROR(ORPSIM-16318): Missing or invalid expression
    ERROR(ORPSIM-16318): Missing or invalid expression
    Circuit has errors ... run aborted
    See output file for details
    INFO(ORPROBE-3188): Simulation aborted
    

    When I check the out.1 file, I can see the errors that probably LTspice was complaining. 

    **** EXPANSION OF SUBCIRCUIT X_U1.X_U16 ****
    .PARAM VTHR 1
    .PARAM GL 1e3
    .PARAM RMAX 1e6
    .PARAM GET1 3e-6
    .PARAM GET2 5e-6
    X_U1.X_U16.EGET1 X_U1.X_U16.NGET1 0 VALUE {1 + GET1*(TEMP-27)}
    X_U1.X_U16.EGET2 X_U1.X_U16.NGET2 0 VALUE {1 + GET2*(TEMP-27)}
    X_U1.X_U16.ES0 X_U1.X_U16.NS0 0 VALUE {MAX(MIN(GL*(V(1#)-VTHR),1),0)}
    X_U1.X_U16.ES1 X_U1.X_U16.NS1 0 VALUE {MAX(MIN(GL*(V(0#)-VTHR),1),0)}
    X_U1.X_U16.E00 X_U1.X_U16.N00 0 VALUE {(1-V(NS1))*(1-V(NS0))}
    X_U1.X_U16.E01 X_U1.X_U16.N01 0 VALUE {(1-V(NS1))*(V(NS0))}
    X_U1.X_U16.E10 X_U1.X_U16.N10 0 VALUE {(V(NS1))*(1-V(NS0))}
    X_U1.X_U16.E11 X_U1.X_U16.N11 0 VALUE {(V(NS1))*(V(NS0))}
    X_U1.X_U16.ESW X_U1.X_U16.NSW 0 VALUE {V(NGET1)*(8*V(N00) + 4*V(N01) + 
    + 2*V(N10))+ V(NGET2)*V(N11)}
    X_U1.X_U16.G1 VOUT X_U1.INN VALUE {V(NSW)*(V(3#,2#)/RMAX)} }
    -----------------------------------------------------------$
    ERROR(ORPSIM-16318): Missing or invalid expression

    Following is the complete INA225_AC_TRANS.out.1

    **** 05/07/25 10:45:55 **** PSpice 23.1.0 (30 January 2024) *** ID# 0 ********
    
     ** Profile: "INA225_TRANS_AC-INA225_AC_TRANS"  [ C:\Projects\SIM\INA225_PSPICE_AIO\ina225-pspicefiles\ina225_trans_ac\ina225_ac_tran
    
    
     ****     CIRCUIT DESCRIPTION
    
    
    ******************************************************************************
    
    
    
    
    ** Creating circuit file "INA225_AC_TRANS.cir" 
    ** WARNING: THIS AUTOMATICALLY GENERATED FILE MAY BE OVERWRITTEN BY SUBSEQUENT SIMULATIONS
    
    *Libraries: 
    * Profile Libraries :
    * Local Libraries :
    .LIB "../../../ina225.lib" 
    * From [PSPICE NETLIST] section of C:\cds_spb_home\cdssetup\OrCAD_PSpiceTIPSpice_Install\23.1.0\PSpice.ini file:
    .lib "nom_pspti.lib" 
    .lib "nom.lib" 
    
    *Analysis directives: 
    .TRAN  0 4ms 0 1u 
    .OPTIONS ADVCONV
    .OPTIONS FILEMODELSEARCH
    .PROBE64 V(alias(*)) I(alias(*)) 
    .INC "..\INA225_TRANS_AC.net" 
    
    
    
    **** INCLUDING INA225_TRANS_AC.net ****
    * source INA225
    R_R1         VMID VOUT  10k TC=0,0 
    E_E1         VMID 0 VCC 0 0.5
    V_V1         VCC 0 5Vdc
    V_VCM         VIN+ 0 12Vdc
    C_C1         VOUT VMID  10p  TC=0,0 
    V_V2         VIN+ VIN- DC 0 AC 1 Sin(0 10m 1KHz)
    V_V3         N241886 0 5Vdc
    V_V4         N241892 0 5Vdc
    X_U1         VIN+ VIN- VCC 0 VMID N241892 N241886 VOUT INA225
    
    **** RESUMING INA225_AC_TRANS.cir ****
    .END
    
    WARNING(ORPSIM-15246): Library index file ina225.ind does not have the correct format
    
    INFO(ORPSIM-15422): Making new index file ina225.ind for library file ina225.lib.
    
    Index has 13 entries from 1 file(s).
    
    
    **** EXPANSION OF SUBCIRCUIT X_U1.X_U16 ****
    .PARAM VTHR 1
    .PARAM GL 1e3
    .PARAM RMAX 1e6
    .PARAM GET1 3e-6
    .PARAM GET2 5e-6
    X_U1.X_U16.EGET1 X_U1.X_U16.NGET1 0 VALUE {1 + GET1*(TEMP-27)}
    X_U1.X_U16.EGET2 X_U1.X_U16.NGET2 0 VALUE {1 + GET2*(TEMP-27)}
    X_U1.X_U16.ES0 X_U1.X_U16.NS0 0 VALUE {MAX(MIN(GL*(V(1#)-VTHR),1),0)}
    X_U1.X_U16.ES1 X_U1.X_U16.NS1 0 VALUE {MAX(MIN(GL*(V(0#)-VTHR),1),0)}
    X_U1.X_U16.E00 X_U1.X_U16.N00 0 VALUE {(1-V(NS1))*(1-V(NS0))}
    X_U1.X_U16.E01 X_U1.X_U16.N01 0 VALUE {(1-V(NS1))*(V(NS0))}
    X_U1.X_U16.E10 X_U1.X_U16.N10 0 VALUE {(V(NS1))*(1-V(NS0))}
    X_U1.X_U16.E11 X_U1.X_U16.N11 0 VALUE {(V(NS1))*(V(NS0))}
    X_U1.X_U16.ESW X_U1.X_U16.NSW 0 VALUE {V(NGET1)*(8*V(N00) + 4*V(N01) + 
    + 2*V(N10))+ V(NGET2)*V(N11)}
    X_U1.X_U16.G1 VOUT X_U1.INN VALUE {V(NSW)*(V(3#,2#)/RMAX)} }
    -----------------------------------------------------------$
    ERROR(ORPSIM-16318): Missing or invalid expression
    
    
    **** EXPANSION OF SUBCIRCUIT X_U1.X_U15 ****
    .PARAM VTHR 1
    .PARAM GL 1e3
    .PARAM RMAX 1e6
    .PARAM GET1 3e-6
    .PARAM GET2 5e-6
    X_U1.X_U15.EGET1 X_U1.X_U15.NGET1 0 VALUE {1 + GET1*(TEMP-27)}
    X_U1.X_U15.EGET2 X_U1.X_U15.NGET2 0 VALUE {1 + GET2*(TEMP-27)}
    X_U1.X_U15.ES0 X_U1.X_U15.NS0 0 VALUE {MAX(MIN(GL*(V(1#)-VTHR),1),0)}
    X_U1.X_U15.ES1 X_U1.X_U15.NS1 0 VALUE {MAX(MIN(GL*(V(0#)-VTHR),1),0)}
    X_U1.X_U15.E00 X_U1.X_U15.N00 0 VALUE {(1-V(NS1))*(1-V(NS0))}
    X_U1.X_U15.E01 X_U1.X_U15.N01 0 VALUE {(1-V(NS1))*(V(NS0))}
    X_U1.X_U15.E10 X_U1.X_U15.N10 0 VALUE {(V(NS1))*(1-V(NS0))}
    X_U1.X_U15.E11 X_U1.X_U15.N11 0 VALUE {(V(NS1))*(V(NS0))}
    X_U1.X_U15.ESW X_U1.X_U15.NSW 0 VALUE {V(NGET1)*(8*V(N00) + 4*V(N01) + 
    + 2*V(N10))+ V(NGET2)*V(N11)}
    X_U1.X_U15.G1 VMID X_U1.INP VALUE {V(NSW)*(V(3#,2#)/RMAX)} }
    -----------------------------------------------------------$
    ERROR(ORPSIM-16318): Missing or invalid expression
    

    Cheers,

    Kaushalya

  • Hi Mallika,

    I think I found the reason. It is an error in the lib file. 

    in line 305 there are one more parenthesis. It should be 

    G1 OUT2 OUT1 VALUE = {V(NSW)*(V(OUT2,OUT1)/RMAX)} 

    Cheers,

    Kaushalya