Import LTspice simulation model into Altium designer

Thread Starter

acheriti

Joined Apr 26, 2020
20
Hey guys,
I've never used LTspice so I don't know much about this software. I'm trying to import some of its simulation models into Altium designer . From my understanding in LTspice each model has its own simulation file(.asc) file. LTspice also uses library file which have the extension *.lib .
Altium allows me to import simulation models that are inside a .lib file.
My question is : how can I create a .lib file from a .asc file in LT spice ?

Thanks a lot guys!
 

crutschow

Joined Mar 14, 2008
27,190
how can I create a .lib file from a .asc file in LT spice ?
Why do you want to?
.asc files are not models, they the simulation files for the circuits you are simulating.
It it not likely possible to transfer simulation files.
All device models are in .lib files.
 

eetech00

Joined Jun 8, 2013
2,350
Hey guys,
I've never used LTspice so I don't know much about this software. I'm trying to import some of its simulation models into Altium designer . From my understanding in LTspice each model has its own simulation file(.asc) file. LTspice also uses library file which have the extension *.lib .
Altium allows me to import simulation models that are inside a .lib file.
My question is : how can I create a .lib file from a .asc file in LT spice ?

Thanks a lot guys!
Hi

Generally speaking, .asc files are schematic files and are proprietary to LTspice. They can probably be converted with a software tool for Altium but I don't know of any tool that can do this.

The .lib file is usually a "spice" coded file. The .lib file extension is generally arbitrary and can be any extension, although certain extensions have meaning to certain simulators. These can be converted somewhat but it depends on how the source spice file was written and the requirements for the target simulator.

Converting simulation files from one system to another can be very involved....

You'll need to find out what the content of the Altium .lib file is supposed to contain.
 

Papabravo

Joined Feb 24, 2006
16,107
Hey guys,
I've never used LTspice so I don't know much about this software. I'm trying to import some of its simulation models into Altium designer . From my understanding in LTspice each model has its own simulation file(.asc) file. LTspice also uses library file which have the extension *.lib .
Altium allows me to import simulation models that are inside a .lib file.
My question is : how can I create a .lib file from a .asc file in LT spice ?

Thanks a lot guys!
The universe of methods is much richer than you imagine. At the dawn of time there was just text. No symbols, no graphical user interface, just a deck of 80 column punched cards that you handed in at a window to an operator, and if you were lucky, you got a printout 24 hours later only to find that your deck got booted because of a syntax error. Fast forward half a century to LTspice. Most simulations involve a flat netlist that can be created graphically on a single sheet. This is the file with the ".asc" file extension. It is an ordinary text file without any practical limitation on line length or file size. You can open, manipulate, and save a ".asc" file with any convenient text editor.

In as much as LTspice has a graphical user interface there was a need to define graphical symbols to represent parts and other circuit elements. thus was created the ".asy" file which is again a text file which does two things. It creates a method to draw a symbol on a fixed grid of points and it assigns various "attributes" to the symbol including "pin order" numbers and pin names and so forth.

LTspice also introduced the idea of allowing the SPICE simulator to process a hierarchical schematic. The mechanism for this is that you put together a top level schematic in a ".asc" file. Each lower level in the hierarchy is represented by identically named schematic/symbol pairs. The schematic has a ".asc" extension, and the symbol has the same name, but with a ".asy" extension.

It is also possible to skip the creation of a schematic for lower levels in the hierarchy and just represent that schematic with a subcircuit file. A subcircuit file has a different syntax and semantics from either the ".asc" file or the ".asy" file. There is not a "standard" extension for a subcircuit file, but some common variations are ".cir", ".mod", ".sub" and others. A collection of similar subcircuits can be collected into a "library: which is often given the ".lib" extension.

The good news is that most of the files you will encounter are ordinary text files which can be opened, manipulated and saved with any convenient text editor. There are a few non text files and there are encrypted files for proprietary modes from some manufacturers. They are however the exception rather than the rule. Unlike real life where everything gets reduced to transistors of one flavor or another many simulations are done with behavioral models as substitutes for real transistor based circuits.

Below is a hierarcial simulation of a buck converter. Buck.asc is the top level. PWMBuck.asc and PWMBuck.asy are the symbol used in the high level schematic and the implementation.
 

Attachments

Last edited:

Thread Starter

acheriti

Joined Apr 26, 2020
20
Hey guys,
Thanks for the answer. From you're answer let me please rephrase my question :
I have a part it LTspice (ADP5070) about which I have three files :
1. ADP5070.asy
2. ADP5070.asc

Is there a way to create a .lib file from these two files that I have?
Thanks a lot.
 

Papabravo

Joined Feb 24, 2006
16,107
Hey guys,
Thanks for the answer. From you're answer let me please rephrase my question :
I have a part it LTspice (ADP5070) about which I have three files :
1. ADP5070.asy
2. ADP5070.asc

Is there a way to create a .lib file from these two files that I have?
Thanks a lot.
You can create any kind of fil that you want, it won't do you any good to combine them into one file. You are going to want the ".asy" file to remain separate so that you can use it to access the schematic or the subcircuit if you decide you wan to create one of those. I don't how to use them except in LTspice, which I can help you with. Porting them to a different environment is up to you to suss out. I can tell what the syntax and semantics of the files mean, but after that I'm at sea.

EDIT: I looked on the ADI website and they are not there so I'm guessing you have some kind of proprietary access to them and are unable to share
EDIT2: WRONG! They come standard with LTspice which is a free download. Let me investigate further.
EDIT3: I cannot open the Symbol Attribute Editor on the symbol (only go to the test fixture, or go to the ADI website for a datasheet) on the schematic, and the subcircuit file (ADP5070_1.sub) is a Binary File, so I guess there is no help for you unless you are looking at something that I am not.
EDIT4: I can open the symbol directly to change parameters on the "Value" line.
 
Last edited:

crutschow

Joined Mar 14, 2008
27,190
Hey guys,
Thanks for the answer. From you're answer let me please rephrase my question :
I have a part it LTspice (ADP5070) about which I have three files :
1. ADP5070.asy
2. ADP5070.asc

Is there a way to create a .lib file from these two files that I have?
Thanks a lot.
Post the two files.
 

Papabravo

Joined Feb 24, 2006
16,107
Hey guys,
Thanks for the answer. From you're answer let me please rephrase my question :
I have a part it LTspice (ADP5070) about which I have three files :
1. ADP5070.asy
2. ADP5070.asc

Is there a way to create a .lib file from these two files that I have?
Thanks a lot.
There are only two files in your list, but I'm guessing you may, depending on what form they are in, be restricted from distributing them. You tell us what you think the situation is.
 

eetech00

Joined Jun 8, 2013
2,350
Hey guys,
Thanks for the answer. From you're answer let me please rephrase my question :
I have a part it LTspice (ADP5070) about which I have three files :
1. ADP5070.asy
2. ADP5070.asc

Is there a way to create a .lib file from these two files that I have?
Thanks a lot.
1. ADP5070.asy is a symbol file. It will be quicker to re-make this is Altium.

2. ADP5070.asc is the test file. It would also be quicker to re-make in Altium.

3. ADP.5070_1.sub is the model file. This is what you really need but, unfortunately, it is only compatible with LTspice and cannot be ported to another simulator.

You might ask Analog Devices if they will provide a Spice compatible model file.
 

Papabravo

Joined Feb 24, 2006
16,107
I guess if you have the unencrypted text file you're all set. I think I'll pass on watching the video. It is not something I need to know.
Buona fortuna!
 

click_here

Joined Sep 22, 2020
182
As a sideline to the video I posted, for anyone who uses Altium Designer I highly recommend the "Altium Academy" on YouTube. There is so much on there.

There are also industry experts which is really good. Rick Hartley has really influenced the way I design PCBs after I saw his speech on "How to achieve proper grounding"
 

Papabravo

Joined Feb 24, 2006
16,107
No, only those that are text.
That's what I thought when I discovered you couldn't modify the symbol attributes from the schematic. You have to open the symbol. Now just because it is a binary file, does that also imply that it is encrypted as well? I've heard of some people who "claim" they can break the encryption schemes. I have no idea if those claims are credible or not, because I've never had occasion to be concerned about it. It seems to me if the goal is to learn the part, that using LTspice as a free download, is not much of an impediment for a company with a critical need. At least we could help with that.
 

eetech00

Joined Jun 8, 2013
2,350
That's what I thought when I discovered you couldn't modify the symbol attributes from the schematic. You have to open the symbol.
(In the following comments, I'm using "model file" to mean the file containing the subckt or model definitions of the device.)

The symbol file is independent of the model file. That is...the symbol file can be edited even though the model file may be a format other than ascii text. There is a certain combination of symbol attributes, that when used, will make the symbol file uneditable in the schematic editor. But it can always be edited with a text editor. The "feature" of making the symbol file uneditable, to me, is just annoying...

Now just because it is a binary file, does that also imply that it is encrypted as well? I've heard of some people who "claim" they can break the encryption schemes. I have no idea if those claims are credible or not, because I've never had occasion to be concerned about it.
No. Binary does not imply encryption although the term is used fairly loosely these days. Companies sometimes use binary character substitution to make a file readable only by their own program. Encryption, on the other hand, requires a public/private key combination to agree to successfully encrypt/decrypt a file. Certain type of encyption can be broken, especially those where a "weak" passphase was used for generating an encryption key.

LTspice has its own version of encryption that can be used to encrypt a model file. Its intended for model developers who wish to protect proprietary information.

Hope that helps...
 

Papabravo

Joined Feb 24, 2006
16,107
I know that symbols and models are separate. I've been working with them for over 30 years. Locking out changes from the schematic is only an indication that the model is not open. That's not for sure, and not for certain, but probably. Since people tend to be careless with terminology and this is the first binary file I have encountered, and I thought it might be helpful to understand if there was a difference between a file that self-consciously announces announces itself as a binary file and one that is encrypted. I'd bet a small sum that the encrypted file lacks such a self-conscious announcement. I have not encountered any encrypted files either. I guess I must not have much of an interest in any of the parts that end up that way. Just as well, I can concentrate on many other things.
 
Top