LTspice

Thread Starter

NY10

Joined Jul 30, 2010
47
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
it.

1) I downloaded MIC4422, from
http://www.micrel.com/_Models1/SPICE/ISPICE/MIC4422ISMOD.txt
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
MIC4422, .SUBCKT, .INCLUDE MIC4422, .INCLUDE MIC4422.SUB
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.
 

eblc1388

Joined Nov 28, 2008
1,542
I believe I followed everything correctly, but some reason my simulation is not working at all.
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?

Rich (BB code):
* Cout line below changed by eblc1388 to suit LTSpice

Cout 1 2 10p
*Cout 1 2 C=(V(9)-4)*1p < 1p ? 1p : (V(9)-4)*1p    (Not working !!!)
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
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

2) I renamed this file to MIC4422.lib, MIC4422.sub, MIC4422.txt
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
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.
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.

Tip:
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.

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
MIC4422, .SUBCKT, .INCLUDE MIC4422, .INCLUDE MIC4422.SUB
8) After all of these, I simulated and got a message saying, "could not
open include file "MIC442".

so now, what is the problem ?
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.
 

eblc1388

Joined Nov 28, 2008
1,542
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:

C. Capacitor

Syntax: Cnnn n1 n2 Q=<expression> [ic=<value>] [m=<value>]


There is a special variable, x, that means the voltage across the device. Therefore, a 100pF constant capacitance can be written as

Cnnn n1 n2 Q=100p*x
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. :(

Rich (BB code):
*Cout 1 2 C=(V(9)-4)*1p < 1p ? 1p : (V(9)-4)*1p    (Not working !!!)

Cout 1 2 Q=(V(9)-4)*1p

 
Top