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.

TINA/Spice/LM5122: Undefined subcircuit error

Part Number: LM5122
Other Parts Discussed in Thread: TINA-TI,

Tool/software: TINA-TI or Spice Models

Hello--I imported the LM5122 Unencrypted PSpice Transient Model to LTSpice using the automatic symbol generation. However, the model is generating an error message "Undefined Subcircuit: d_d1" (See attached picture). Kindly please advise. Regards. 

  • Walid,

    I do not see any issues with the model. D_D1 is defined in the unencrypted library file. We are unable to support our models in LTSpice. I would recommend using TINA-TI instead. This model has already been setup in TINA-TI so it will get you up and running much faster.

    www.ti.com/.../toolssoftware

    Also, if you are new to TINA-TI, going through the following set of short videos will go a long way.

    training.ti.com/tina-ti-video-training-series
  • I had the same problem. Open the file with a text editor, like Note Pad. Then down at the bottom you will read this:

    .MODEL _switchM VSWITCH Roff=100e6 Ron={RDSON} Voff=1.1 Von={VSP}
    .model Dbreak D IS=1e-15 TT=10p Rs=0.05 N=0.1
    .ends POWERMOS
    *$
    .END
    *$
    .subckt d_d1 1 2
    d1 1 2 dd1
    .model dd1 d
    + is=1e-015
    + tt=1e-011
    + rs=0.05
    + n=0.1
    .ends d_d1
    *$
    .subckt d_d 1 2
    d1 1 2 dd
    .model dd d
    + is=1e-015
    + n=0.01
    + tt=1e-011
    .ends d_d

    As you can see, before the subckt d_d1 1 2, there is a ".END" that finishes the file, so the diode sub circuit is not taken into account. So make it like this (move it to the end of the file):

    .MODEL _switchM VSWITCH Roff=100e6 Ron={RDSON} Voff=1.1 Von={VSP}
    .model Dbreak D IS=1e-15 TT=10p Rs=0.05 N=0.1
    .ends POWERMOS
    *$
    .subckt d_d1 1 2
    d1 1 2 dd1
    .model dd1 d
    + is=1e-015
    + tt=1e-011
    + rs=0.05
    + n=0.1
    .ends d_d1
    *$
    .subckt d_d 1 2
    d1 1 2 dd
    .model dd d
    + is=1e-015
    + n=0.01
    + tt=1e-011
    .ends d_d
    .END

    It should work now. I have done that, but I still have other problems with the circuit in LTspice, like short-circuit sources. If you can make it work after this correction, please let me know.
  • Hi, TINA is also throwing the same error 'Undefined Subcircuit: d_d1'when I tried to model LM5122 using Unencrypted file. FYI.
  • Hi Janaki,

    The error  'Undefined Subcircuit: d_d1' can be resolved by removing  .END statement from the Unencrypted file as shown below.

    Thanks,

    Vivek Agarwal

  • Yes I know, I have been using with the same edit thanks to Isaias Santucho's post. I am commenting at  "I do not see any issues with the model. D_D1 is defined in the unencrypted library file"  in the above reply so that changes will be made in TI site. Thanks for the post @Vivek Agarwal.