Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to simulate MAXIM Spice Files using LTSpice program?

Status
Not open for further replies.

blackshadow

New Member
guys,

i have downloaded 3 different file types of MAX4173 from MAxim;

macromodel > .FAM
orcad library > .LIB
test circuit > .CIR

Now, how do i use these files so i can simulate it on LTSpice?
 
Hi Shadow,

If you look at the Maxim files, you'll see that the model .fam and Orcad .lib files are identicle and fully compatable with the LTSpice .sub subcircuit files. Save one or the other in the .sub directory in a new folder (with a general name of your choice for its type) so it can be sourced easily if necessary. Remember the full path, name and extention it is saved as for the .inc spice directive such as .inc {folder name}/MAX4173T.sub. You will have to built a 6 pin block if you use the include directive; I couldn't find one readily avalilable.

I went ahead and built a the block and edited it as a symbol file (.asy). If you would like that option, I'll post it below and you can put it in your symbol library. The Symbol Attribute line of SpiceModel may have to be edited since it's pathed to the location of my .sub MAX4173.

Version 4
SymbolType BLOCK
RECTANGLE Normal 112 96 -112 -96
TEXT -79 -64 Left 0 Gnd
TEXT -80 0 Left 0 Gnd
TEXT -79 65 Left 0 Vcc
TEXT 81 65 Right 0 Rs+
TEXT 81 0 Right 0 Rs-
TEXT 80 -64 Right 0 Out
PIN -112 -64 LEFT 8
SYMATTR Value MAX4173T
SYMATTR Prefix X
SYMATTR SpiceModel Misc\MAX4173T.sub
SYMATTR Value2 MAX4173T
SYMATTR Description SOT23, Voltage-Output, High-Side Current-Sense Amplifier
PINATTR PinName 1
PINATTR SpiceOrder 1
PIN -112 0 LEFT 8
PINATTR PinName 2
PINATTR SpiceOrder 2
PIN -112 64 LEFT 8
PINATTR PinName 3
PINATTR SpiceOrder 3
PIN 112 64 RIGHT 8
PINATTR PinName 4
PINATTR SpiceOrder 4
PIN 112 0 RIGHT 8
PINATTR PinName 5
PINATTR SpiceOrder 5
PIN 112 -64 RIGHT 8
PINATTR PinName 6
PINATTR SpiceOrder 6

I've attached a sim of the basic circuit with an input ramp from 3V to 28V and graphed the output voltage and load current to display the degree of error over the entire range. Rsense and Rload values were chosen arbitrarilary withing the ranges from the datasheet; your needs will likely differ.

Hope this helps you with your project.
 

Attachments

  • MAX4173T.jpg
    MAX4173T.jpg
    202.8 KB · Views: 958
  • MAX4173T2.jpg
    MAX4173T2.jpg
    235.4 KB · Views: 812
Last edited:
Hi MRCecil.

I do appreciate your inputs. Actually my project requires MAX4172 but because i can't find a SPICE file available, i just use this MAX4173.

Now this is what i did:

1. SUB File: I copy & paste the MAX4173T.lib file, "C:\Program Files\LTC\LTspiceIV\lib\sub"
2. .ASY File
a. I changed the folder path from SYMATTR SpiceModel Misc\MAX4173T.sub to SYMATTR SpiceModel MAX4173
T.lib
. I just omitted the "Misc" word and replace the file type to .lib
b. I saved the block above as .asy file (MAX4173T.asy) in this folder, "C:\Program Files\LTC\LTspiceIV\lib\sym"

3. I then opened the symbol file in LTspice with the include directive and it says "Could not open library file "Misc\MAX4173T.sub" (see attachment)
What went wrong?
 

Attachments

  • MAX4173 LTSpice error.JPG
    MAX4173 LTSpice error.JPG
    83.1 KB · Views: 662
Regarding the .sub file, what is the FULL file name from C:\Program Files\LTC\LTspiceIV\lib\...?

Regarding the .asy file, it appears you did not save the file as edited. Note that the error message says it could not find Misc\MAX4173T.sub. If you did not save the .sub file to a separate folder and simply placed it in the general .sub folder, then you must modify the path in the .asy file to EXACTLY where it is located in the SYMATTR SpiceModel line. For instance, if you put the subcircuit file in the general .sub directory, the SYMATTR SpiceModel line would read "SYMATTR SpiceModel MAX4173T.sub" only. If you placed it in a sub folder named "my stuff" it would read "SYMATTR SpiceModel my stuff\MAX4173T.sub".

If you are still having issues, let me know.
 
For the .SUB, the full file name is "C:\Program Files\LTC\LTspiceIV\lib\sub\MAX4173T.lib"

For the .ASY, please take note that i already changed the path in the .asy file since i put my .ASY file inside the general folder, "C:\Program Files\LTC\LTspiceIV\lib\sym\MAX4173T.asy".
 
For the .SUB, the full file name is "C:\Program Files\LTC\LTspiceIV\lib\sub\MAX4173T.lib"

OK, good. But that is not the file that is being called from the .asy file. In your post #3, look at the error message and see the file called matches the SYMATTR line I highlighted in my post #2.


For the .ASY, please take note that i already changed the path in the .asy file since i put my .ASY file inside the general folder, "C:\Program Files\LTC\LTspiceIV\lib\sym\MAX4173T.asy".

OK, good. But from your error message, it tells me that you did not edit the SYMATTR line before you saved it. With the model saved as "C:\Program Files\LTC\LTspiceIV\lib\sub\MAX4173T.lib", that is where LTSpice is going to look for the file with that name and extension. But the prog is being told to look for, "C:\Program Files\LTC\LTspiceIV\lib\sub\Misc\MAX4173T.sub".

Sorry for being verbose, but this can be an area of issues and I guess I wasn't clear in my #2. You will have to go into the symbol file and edit it. The line that reads,

SYMATTR SpiceModel Misc\MAX4173T.sub must be edited to read SYMATTR SpiceModel MAX4173T.lib.

One last thought...did you save the file in the .sub directory as a sub file or a library file?

Hope this works for you this time. Good Luck!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top