![]() | ![]() | ![]() |
| | |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Hi I'm trying to simulate a circuit with a LM386 with switchercad, and since that IC isn't defined in the programs library, I looked up a spice model on the net. The problem is I cant seem to get the whole thing working. This is what I do: I saved the spice model in a file called LM.lib in \lib\sub . The file is attached. I placed a 8 pin din, and entered the following fields: Prefix: X InstName: lm386 SpiceLine: .INCLUDE LM.lib Now, when i try to run the simulation I get the following error: SPICE Error Unknown subcircuit called in: xlm386 n002 n001 n004 0 p001 n003 nc_01 n002 .include lm.lib what am I doing wrong? | |
| |
| | (permalink) |
| These are related topics on this forum. http://www.electro-tech-online.com/g...uestion-2.html http://www.electro-tech-online.com/e...l-ltspice.html I haven't used the lm386 model, though. | |
| |
| | (permalink) |
| ok, thanks. The only thing I havent tried in those posts are renaming the file tom LM.sub, instead of .lib, but that didn't do anything... What exactly does the error message mean? That the file isn't found, or that the file is faulty? | |
| |
| | (permalink) |
| Use the SPICE directive '.include lm386.sub' (check the filename!) to specify the model. Be sure you've re-started LTSPICE. | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) | |
| Quote:
I usually use a SPICE directive (menu 'Edit'->SPICE directive). Type 'include lm386.sub' in the edit box and place the label in the schematic. | ||
| |
| | (permalink) |
| geez... nothing seems to work. I've tried everything, exactly as it says in the posts. I also tried using another lib-file, just to see if there was something wrong with the one I tried, but the same error message. I wonder if the path isnt found? | |
| |
| | (permalink) |
| I've just gone through the same steps and the simulation runs with no errors. The results are quite unexpected though, but this is another issue. (*) I've tried to cancel the 'include' directive and I've got the error message. It seems that the program can't find the file in your computer. There must be something wrong with the file name or its extension or paths as you said. (*)EDIT: I've tried another model that produces the results I expected: http://www.electro-tech-online.com/g...del-lm386.html This is my schematic, if it helps: Last edited by eng1; 3rd August 2007 at 07:15 PM. | |
| |
| | (permalink) |
| Alright! Now it works. Using the full path to the sub file and realising (thanks to your schematic) that I had put the model name in the wrong field, made it work. Thanks A LOT for the quick help... | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| LM386 model in LTSpice | Inverted | Electronic Projects Design/Ideas/Reviews | 6 | 16th April 2007 08:19 AM |
| Configurable opamp model for Spice | Optikon | General Electronics Chat | 0 | 1st February 2007 06:55 PM |
| Spice model LM386 | habbott | General Electronics Chat | 5 | 10th August 2006 06:47 PM |
| LM317 Spice Model? | adamthole | General Electronics Chat | 5 | 20th October 2005 01:12 AM |
| 741 spice model for switcherCAD III | samcheetah | General Electronics Chat | 2 | 6th December 2004 06:10 PM |