Discussion in 'General Electronics Chat' started by NY10, Aug 26, 2010.

  1. NY10

    Thread Starter Member

    Jul 30, 2010
    Hi, all

    Does anybody know LTspice well ? I am having difficulty simulating. The following is what I did in order to simulate it.

    If I did something wrong, please let me know.

    I am at a point that I don't know where to start, so I am posting this
    message. I have done everything that is available to create a spice
    model for MIC4422. However, some reason it did not work at all.

    So, I am going to type the procedure that I went through step by step.
    If anyone recognize what I did wrong, please correct me. I do appreciate

    1) I downloaded MIC4422, from
    2) I renamed this file to MIC4422.lib, MIC4422.sub, MIC4422.txt
    3) I opened the LTspice, and edited the symbol that is already existed.
    (In LTspice, component-> Misc-> DIP8)
    4) After I edited DIP8 file (this symbol has 8 pins, so I deleted 4 pins
    accordingly because MIC4422.txt shows only 4 pins used), I saved as
    MIC4422 in Misc directory.
    5) I closed LTspice.
    6) I copied the MIC4422.lib, MIC4422.sub, and MIC4422.txt files into
    C\program files\LTC\LTspiceIV\lib\sub
    7) I re-opened the LTspice and built the rest of circuit. In the
    meantime, spice directive, I typed .INCLUDE MIC4422.lib, .MODEL
    8) After all of these, I simulated and got a message saying, "could not
    open include file "MIC442".

    so now, what is the problem ?

    I believe I followed everything correctly, but some reason my simulation
    is not working at all.

    Can someone please explain what I did or what I need to fix or any type
    of help ?

    Thank you very much in advance.
  2. eblc1388

    AAC Fanatic!

    Nov 28, 2008
    Here is something for you to try, in the file MIC4422.ZIP which contains the asc simulation file and both the .asy file and the .sub model file.

    Place the MIC4422.sub into \lib\sub directory
    Place the MIC4422.asy into \lib\sym\Misc directory

    Note the changes I've made in the MIC4422.sub model file so that LTSpice can run with the model.

    For the real LTSpice guru please check why the following statement inside the original MIC4422.sub model from the manufacturer has caused error in LTSpice?

    Code ( (Unknown Language)):
    2. * Cout line below changed by eblc1388 to suit LTSpice
    4. Cout 1 2 10p
    5. *Cout 1 2 C=(V(9)-4)*1p < 1p ? 1p : (V(9)-4)*1p    (Not working !!!)
  3. NY10

    Thread Starter Member

    Jul 30, 2010
    Thank you so much.
  4. SgtWookie


    Jul 17, 2007
    Sometimes, the way you download it can mess the file up. Often what I'll do when it's a text file, is to simply display it in my browser, then select all, copy it, and paste into NotePad - then save it in Program Files\LTC\SwitcherCad\lib\sub with an extension of .SUB

    You only need a single file. I usually use an extension of .SUB for single subcircuits. If there are several .SUBCKT's in a file, then I save it as a .LIB
    You can do that. In this case, it's just as easy to create a new symbol.

    Start by drawing a rectangle using the "R" command. 6x6 dots works well for this particular device.
    Then drop the four pin connections you'll need. I labeled them "Vc", "In", "GND" and "Out". Make sure the netlist order agrees with the parameters after .SUBCKT MIC4422 in the .SUB file.

    Go into Edit -> Attributes -> Edit Attributes
    In the Prefix box, put "X" (no quotes).
    In the SpiceModel box, use the text that immediately follows .SUBCKT, in this case "MIC4422" (no quotes).
    In the Model box, put the filename that contains the circuit; in this case MIC4422.SUB Once you put this value in Model, you no longer have to use .INC modelname in your simulation. It's really handy with .LIB files, because you can use the same .sym file to select any of the models in the file.
    Filling out the Description box will help you identify it later. In this case, I put in "9A Non-Inv MOSFET Gate Driver"

    Then click OK, then go to Edit -> Attributes -> Attribute Window.
    Click InstName, and drop it on top of your symbol. Right-click on it, and change the alignment to "Centered".
    Click SpiceModel, and drop it on the bottom of your symbol.

    You may not have changed the type to CELL, and the prefix to X.

    There's still a problem with the subcircuit; a math operation that LTSpice does not interpret.

    This is something that the Yahoo! LTSpice User Group could give a hand with.

    If you have not signed up, do so.
  5. SgtWookie


    Jul 17, 2007
    Gee, I sure took a long time to post that. :rolleyes:
  6. eblc1388

    AAC Fanatic!

    Nov 28, 2008
    Regarding the value of the Cout capacitor value in the Spice model of MIC4422.sub, this is what LTSpice said in its help file about the capacitor element:

    It indicates that one can represent the value of the element with a value of charge Q instead and this charge Q is in the form of capacitance * voltage.

    The expression in the manufacturer's model also express this value in the form of voltage * capacitance but has chosen the identifier "C" instead of "Q".

    I then modified the model as per the above reasoning and LTSpice no longer complaints.

    Whether this modification is valid I have no idea. :(

    Code ( (Unknown Language)):
    1. [COLOR=black][FONT=Courier New]
    2. [/FONT][/COLOR]*Cout 1 2 C=(V(9)-4)*1p < 1p ? 1p : (V(9)-4)*1p    (Not working !!!)
    4. Cout 1 2 Q=(V(9)-4)*1p

  7. SgtWookie


    Jul 17, 2007
    I just gave that mod a try - boy, it sure made the simulation screech to a halt when trying to turn a MOSFET off!