Post Go back to editing

Trying to use MAX40089 spice model with LTSpice

Category: Software
Software Version: LT Spice x64 v17.1.11

Hi,

I'm trying to get the MAX40089 spice model to work in LT Spice. I don't really need a dual opamp (the model is configured that way), but I need the de-compensated version of the MAX40079 which is the MAX40087 or MAX40089.  I downloaded the model from the Analog Devices MAX40089 web page.

I made a symbol for4578.MAX40089 Test Circuit -001.asc a dual opamp matched to the (non-standard) pin list in the MAX40089 spice model.

I get the following error

Fatal Error: Unknown subcircuit called in:
   x:u1:_1 out«:outa» v-«:vss» n002«:ipa» n001«:ina» u1:vdd1 u1:opamp

Thank you,

Morty

Thread Notes

  • Hello  ,

    The spice model that can be seen in the product page for MAX40089 is a macro model. With that, it is recommended to create each symbol per part. Have you tried creating each symbol and try to run it and see if there's still an error?

    Thanks,

    Mae

  • Yes, of course.

    I saved the spice model, then I made a symbol that looks like a dual opamp. I got the error.

    Unknown subcircuit called in:
    x:u1:_1 out«:outa» v-«:vss.» n002«:ipa» n001«:ina» ul:vddl ul:opamp

    The I had LTSpice auto-generate the symbol and used that in the spice circuit. I got the same error.

    Here's the netlist with the auto-generated sybol:

    :* D:\Morty\_ Spice Simulations\Test Circuits\MAX40079 Test Circuits\MAX40089 Test Circuit -002.asc
    R1 N001 0 10R
    R2 out N001 1K
    V1 N002 0 SINE({offset} {ampl} {freq}) AC 1V
    V2 V+ 0 3.5V
    V3 0 V- 2.0V
    XU1 out N001 N002 V- 0 out0 out0 V+ MAX40089
    .param num_fft_pts 131072
    .param timestep {1/((num_fft_pts)*freq/9)}
    .tran 0 {10/freq} 0 {timestep}
    ;ac oct 128 10 1e8
    .options plotwinsize=0
    .options numdgt=10
    .four {freq} 10 9 V(out) V(out+) V(out-)
    .param ampl = 10.0mV
    .param freq = 1K
    .paramp offset = 0V
    ;noise V(out) V1 oct 256 20 20K
    * Symbol in folder\nAutoGenerated
    .lib ADI\max40089.lib
    .backanno
    .end

    Try, I think you'll get the same error. This is a Maxim model not compatible with LT Spice. Now that Analog owns both Maxim and LT Spice, would it be possible to fix the model?

    Thank you,

    -Morty

    PS: I tried to upload the .asc file but kept getting invalid URL errors. It would be nice to be able to upload a file so we're talking about exactly the same thing.

  • 0
    •  Analog Employees 
    •  Super User 
    in reply to MTarr

    Hello  ,

    We were able to fix the model issue, but I am still coordinating with the team to upload the updated netlist file. For the mean time, I can send the file in your email/chat since I am having an issue with attaching the file. 

    Also, I just want to share that there's an updated LTspice version (Version 24.0.9) in which you can downlink in LTspice Information Center | Analog Devices

    Thank you!

    Regards,

    Mae

  • Hi,

    I would appreciate receiving the updated file file by email.

    Thank you for looking into this.

    Morty Tarr

  • +1
    •  Analog Employees 
    •  Super User 
    in reply to MTarr

    Hello Morty,

    I've encountered an issue with a previous email not getting through. I've attached a .txt file with the updated content; you should be able to copy and paste it into .lib to proceed. Apologies for the inconvenience. 

    * MAX40089 MACROMODEL
    * ------------------------------
    * Revision 0, 11/2017
    **************************************************************************************
    .SUBCKT MAX40089 OUTA INA IPA VSS IPB INB OUTB VDD
    X_1 OUTA VSS IPA INA VDD1 opamp
    X_2 OUTB VSS IPB INB VDD1 opamp
    Vsh VDD VDD1 0
    Gsh VDD 0 VALUE={-I(Vsh)+4.5m*V(ctl)+0.4u}
    X_sh 0 SD ctl shutdown
    .ends
    .SUBCKT shutdown 18 91 cs
    **************************************************************************************
    V10a 10 18 5
    E20 20 18 10 18 0.5
    Ecs cs 18 VALUE={V(96)-V(20)}
    *SHUTDOWN
    RSHIN 91 20 5000K
    ESH3 220 20 91 18 1
    RSHA 220 221 1K
    CSHA 221 20 32P
    ESH2 92 20 221 20 1
    RSH1 92 93 100
    VSH1 93 94 0V
    EHYS 95 94 POLY(2) 10 18 96 20 0 0 0 0 0.03
    RBL 94 20 10K  
    ESH1 95 20 10 18 0.45
    ****
    E96 96 18 value={if(I(vsh1)<0,2.5,3.5)}
    .MODEL DA D(N=10M)
    .ends
    **************************************************************************************
    .SUBCKT opamp 202 18 17 15 10 
    *111a
    ***************
    So1 201 202 ctl 0 smod1
    .model smod1 VSWITCH (Ron=0.1 Roff=10g Von=0.8 Voff=0.5)
    X_sh 0 111a ctl shutdown
    *INPUT STAGE
    VS1 10 11 0V
    GBIAS 11 12 304 100 50U 
    *L1 202 203 4n
    *Rl1 202 203 400
    *Vo1 10 500 912m
    *Vo2 501 18 915m
    *Do1 202 500 DY3
    *Ro11 202 2000 1000
    *Co11 2000 500 100p
    *Do2 501 202 DY3
    .model DY2 D(IS=5E-14 N=1 RS=1m TT=0.1p VJ=0.6 FC=0.1 IBV=0.001 CJO=0)
    ***********************************************************************************
    .MODEL DY3    D
    + IS = 2.556412E-12
    + RS = 4.959919E-3
    + N = 1.24864
    + IKF = 2.55086E-3
    + TT = 0
    + CJO = 0
    + VJ = 1
    + M = .5
    + EG = 1.11
    + XTI = 3
    + KF = 0
    + AF = 1
    + FC = .5
    + BV = 1E5
    + IBV = .001
    ***********************************************************************************
    M1 13 16 12 11 MOSFET
    M2 14 15 12 11 MOSFET
    DBIAS 18 12 DY
    VOS 17 16  75u
    RD1 13 18 1K    
    RD2 14 18 1K
    C1 13 14 1P
    CIN1 16 100 10P
    CIN2 15 100 10P     
    DIN1 16 11 DA
    DIN2 18 16 DA
    DIN3 15 11 DA
    DIN4 18 15 DA
    FSUP 18 10 VS1 1 
    J1 13 14 13 JNC
    J2 14 13 14 JNC
    .MODEL JNC NJF
    **************
    *INPUT BIAS CURRENT 
    IBIAS1 18 17 2.5p
    IBIAS2 18 15 3.5p
    GBIAS1 17 18 10 18 1p
    GBIAS2 15 18 10 18 1p
    RID 15 16 1000G 
    **************
    **************************************************
    *GAIN STAGE 
    GA 25 100 14 13 4M  
    RO1 25 100 10k
    GB 26 100 25 100 180M
    RO2 26 100 1K
    EF 27 100 26 100 1
    CC 25 27 7P
    EF2 29 100 28 100 1  
    GC 100 28 26 100 22.16M
    RO3 28 100 2.7k
    CC2 25 29 18.3p
    RO4 28 30 0.020
    GCMPS 100 25 40 100 393.5U 
    **************
    *CURRENT LIMIT
    DP3 26 38 DY
    EP3 38 100 10 18 1
    DP4 39 26 DY
    EP4 100 39 10 18 1
    **************
    *INTERNAL GND
    EG1 100 18 10 18 0.5
    **************
    *VOLTAGE LIMITING
    VS2 30 31 0V
    *****
    DP1 30 32 DY 
    HP1 34 32 VS2 17.72
    EP1 34 36 10 18 0.5
    VOFF1 100 36 664M
    *****
    DP2 33 30 DY
    HP2 35 33 VS2 14.43
    EP2 37 35 10 18 0.5
    VOFF2 37 100 664.8M
    ***************
    *CMRR
    RRR 40 100 1
    GCMR 40 100 12 18 33u
    GPSR 100 40 10 18 28u
    ***************
    *FOR SHUTDOWN
    E103 103 18 10 18 1
    MEN1 171 172 31 10 MOSFETP
    MEN2 171 173 31 18 MOSFETN
    EEN3 170 172 304 100 10
    EEN4 173 170 304 100 10
    RSHUNT 170 171 10MEG
    VIS5 171 400 0V
    R171 171 18 100k
    D401 400 401 DY1
    D402 402 400 DY1
    D403 201 401 DY1
    D404 402 201 DY1
    I400 401 402 50m
    ********************************
    RSH 103 18 500MEG
    ISH 18 103 10NA
    DSH 103 10 DY
    CSH 103 18 10P
    **************
    EEN2 300 100 103 18 1
    REN 300 301 10K
    VEN 301 302 0V
    EHYST 303 302 POLY(2) 10 18 304 100 0 0 0 0 0.4
    EEN1 303 100 10 100 0.7
    **************
    FEN1 100 304 VEN 12
    CEN 304 100 1P
    DEN1 100 304 DY
    DEN2 304 305 DY
    VLIM1 305 100 1V
    **************************************************
    .MODEL DA D(IS=100E-14 RS=0.5k)
    .MODEL MOSFET PMOS(VTO=-0.2 KP=29.3E-3 KF=4.4E-26 AF=0.8)
    .MODEL DX D(IS=100E-14)
    .MODEL DY D(IS=100E-14 N=1)
    .MODEL DY1 D(N=10m)
    .MODEL MOSFETP PMOS(VTO=-5.0  KP=88E-3 GAMMA=0.01)
    .MODEL MOSFETN NMOS(VTO=5  KP=88E-3 GAMMA=0.01)
    **************************************************
    .ENDS
    

    If you experience an issue, you can ask a question again through posting a new question. Thanks!

    Best regards,

    Mae

  • Hi Mae,

    Thank you, the model seems to work. It reports distortion lower than expected, but functionality is more important than that.

    Just to note -  LT Spice reports 2 warnings when running any simulation with this model:

    u1:_1:dy1: Emission coefficient, N=0.01, too small, limited to 0.1
    u1:_2:dy1: Emission coefficient, N=0.01, too small, limited to 0.1

    One for each instance of the opamp. I get these warnings in my models as well. LT Spice used to accept N = 0.01, now it doesn't.

    Thank you,

    Morty

  • 0
    •  Analog Employees 
    •  Super User 
    in reply to MTarr

    Hello Morty,

    May we know how did you simulate the part so we can understand where the error is coming from? I tried it on my side and it's working accordingly. I am using the latest version of the LTspice and updated its components. Are you using the same version?

    Also, I added  as assignee since she's the one handling the part to assist you further. 

    Thanks,

    Mae

  • Hi Mae, LiliPod,

    I am working on an ultra low noise EKG front end for a client. They want to significantly better than the TI ADS1299.

    Since the gain will greater than 5, it makes sense to evaluate the MAX40079 and the MAX40089, even though the bandwidth will be under 100Hz. Thank you for making the MAX40089 spice model work.

    -Morty

    PS: It would be helpful to be able ot insert files in this conversation.

  • I'm using version 17.1.11. In the past 1 -2 years, there have been too many changes that affect the results obtained from the simulations. I would be willing to try the newest version, but only if I could have both versions concurrently, re-install my current version. I am not sure which version of the installer is v17.1.11. Perhaps you could let me know.

  • I am now closing this thread as we are taking this issue offline.

    -L