Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


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?

Reply
 
LinkBack Thread Tools Display Modes
Old 3rd August 2007, 10:29 AM   (permalink)
Default spice model of lm386 in switchercad

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?
Attached Files
File Type: txt LM.lib.txt (2.1 KB, 15 views)
hadoque is offline  
Old 3rd August 2007, 11:32 AM   (permalink)
Default

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.
eng1 is offline  
Old 3rd August 2007, 12:01 PM   (permalink)
Default

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?
hadoque is offline  
Old 3rd August 2007, 12:35 PM   (permalink)
Default

Use the SPICE directive '.include lm386.sub' (check the filename!) to specify the model. Be sure you've re-started LTSPICE.
eng1 is offline  
Old 3rd August 2007, 12:56 PM   (permalink)
Default

Quote:
Originally Posted by eng1
Use the SPICE directive '.include lm386.sub'
I thought that was what I was doing with the "SpiceLine" field. If not, could you expain how to do that?
hadoque is offline  
Old 3rd August 2007, 01:01 PM   (permalink)
Default

Quote:
Originally Posted by hadoque
I thought that was what I was doing with the "SpiceLine" field. If not, could you expain how to do that?
I don't know if that works, but the filename is wrong?

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.
eng1 is offline  
Old 3rd August 2007, 06:18 PM   (permalink)
Default

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?
hadoque is offline  
Old 3rd August 2007, 06:32 PM   (permalink)
Default

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:
Attached Images
File Type: png 386.png (9.6 KB, 32 views)

Last edited by eng1; 3rd August 2007 at 07:15 PM.
eng1 is offline  
Old 3rd August 2007, 07:33 PM   (permalink)
Default

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...
hadoque is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
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



All times are GMT. The time now is 09:01 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker