Hello
My problem is that I download LM317 Spice model from yahoo,when I copy this model to another circuit which a simple voltage regulator and simulate this circuit,but there show belowing error:
unkown subcircuti called in:
xu2 n001 n002 vout LM317
I use yahoo itself LM317 test circuit for simulating,and the reasult is right.so just wonder why my circuit will happen error,how to use this LM317 spice model.show me the detail and easily understand step.thank you very much.
First, the attribute on the symbol has to match the modelName/subscircuitName.
Second, you have to have a .Include statement somewhere on the schematic which has the file name of the library containing the model/subscircuit netlist.
Third, the file containing the model/subscircuit netlist must be copied to the same subdirectory where the circuit file resides.
Fourth, the library file has to contain a .Model or .Subcircuit entry line and netlist with a name that matches what is on the symbol in your schematic.
Hello
Still not solve my problem,though do what your indication.Maybe I'm a not clever man and not understand your meaing completely,I just want to let LM317 LTspice Model work.what should do?Give me your detail step?Thank you.
Trust me, it works.
it doesn't get much easier, but it can get a bit easier if I attach files directly. You'll still have to copy them to where they need to go. Put the first one in the symbol library directory (files ending in .asy), ideally in subdirectory called misc. Put the second one in the .sub files directory.
Then select the symbol in the schematic editor. it will work because all the internal references are correct.
I think if you copied my earlier text correctly and saved it, you are using a text editor that is saving in Unicode, not plain text. Take care of that, you need to be very sure you use plain text when saving programming code of any type.
Hello
Thank you very much,zoodlewurdle.You are right,Just trust you,then I succeed to use LM317 LTspice Model on my circuit and the simulation is right.But,I need to know one thing?
what's your meaning"you are using a text editor that is saving in Unicode, not plain text. Take care of that, you need to be very sure you use plain text when saving programming code of any type.
"
I often copy these files on text editor .txt and then save as it LM317.asy,what's wrong with me?Pls correct me.
Unicode is a way to store all the charaters used in maths symbols and other written languages. Computers used to use 'code pages' that stored only 256 characters. People neede dmore than that so code page swapping was needed. That didn't work well for many people so Unicode was made to store all the characters in one huge scheme that addresses up to 65536 possible characters. To do that it takes 2 bytes, not just 1 as ASCII does.
What that means is that if you have a new machine with a new operating system, there's a good chance it's storing a 'plain' text file in Unicode, not ASCII, and not telling you. So a variable 'A' in a computer language will be expressed as two bytes to a system that expects A as a single byte value 65. Chaos results. Or usually something just doesn't work.
If you're ever in doubt, get a hex editor like HxD (truly awesome tool, and free), that will show you EXACTLY what's really inside your files.
This is the first one i have tried to add and after a few hours I think it's time to ask for help. For some reason I could not uzip the zipped files so I copied the code from the 2 windows above and pasted into word pad. I then saved into lib\sym\misc as lm317.asy (text file) Same with the model into lib\sub as a text file. When i click on the 317 under misc it blinks but no symbol. It all seems pretty complicated but i think I'm close.
zoodlewurdle - Don't know if you're still around - I've only just registered. Just like to thank you for the code listings for the LM317, which worked first time with LTspiceIV (I've just updated from the old SwitcherCAD III, not having needed to do any simulation for some time).
Could you please let me know where the model code originated?
zoodlewurdle - Don't know if you're still around - I've only just registered. Just like to thank you for the code listings for the LM317, which worked first time with LTspiceIV (I've just updated from the old SwitcherCAD III, not having needed to do any simulation for some time).
Could you please let me know where the model code originated?
i implemented the LM317 into some of my circuits and it made them act erratic, so i tried it in it most simple form and it doesn't work as it should, could anyone explain what i have done wrong
You may want to read this thread where the LM317 is well covered. Also, I don't quite understand your resistor values? However, read the linked thread.
Why simulate a simple voltage regulator?
If you make it like described in its datasheet then it works perfectly.
Your sketch had very odd very low value resistors and was missing an input and an output capacitor so it will problably mess-up.
The SIM program probably hasn't seen such a mess so it won't know what to show.
I ran your sim out of curiosity. It will run, even as you drew it, with correct resistor values. Make R1 for example 240R and R2 something reasonable (read the data sheet) and it should run. Use the GND as mentioned. Keep in mind that you will need caps as AG points out in an actual circuit. You should have gotten a ground error when you tried to run it.
hello anybody have mcp6002 model for LT spice, i just want to use it in my project but i didnt find it on LT spice library.
i would appriciate if someone attache me the model file.
thanks
There is a text editor in LTspice that shows all the text in the model. Notepad can sometime hide control characters that have been inserted when using Unicode. this will upset LTspice. Open the file in LTSpice and you should be able to see any control characters that are upsetting it