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.

A working Lm386 model for multisim?

Status
Not open for further replies.

maor

New Member
I've been looking for a long time a model of an lm386 for Multisim, I use Multisim 11 and I used the code a user named roff posted on this forum back in 2006 but I keep getting an error
Code:
------ Checking SPICE netlist for Design1 - יום*שלישי 20 אפריל 2010, 22:23:28 ------ 
SPICE Netlist Error in schematic RefDes 'u1', element 'au1':  Unable to identify XSPICE code model for simulation in netlist element 'au1'
SPICE Netlist Error in schematic RefDes 'u1', element '<unknown>':  Due to errors, the component 'au1' has been omitted from the simulation
======= SPICE Netlist check completed, 2 error(s), 0 warning(s) =======
Can anyone help me?

Edit:

Oh and the code is:
Code:
* lm386 subcircuit model follows:

************************************original* IC pins:     2   3   7   1   8   5   6   4
* IC pins:     1   2   3   4   5   6   7   8
*              |   |   |   |   |   |   |   |
.subckt lm386 g1  inn inp gnd out  vs byp g8
************************************original*.subckt lm386 inn inp byp  g1  g8 out  vs gnd

* input emitter-follower buffers:

q1 gnd inn 10011 ddpnp
r1 inn gnd 50k
q2 gnd inp 10012 ddpnp
r2 inp gnd 50k

* differential input stage, gain-setting
* resistors, and internal feedback resistor:

q3 10013 10011 10008 ddpnp
q4 10014 10012 g1 ddpnp
r3 vs byp 15k
r4 byp 10008 15k
r5 10008 g8 150
r6 g8 g1 1.35k
r7 g1 out 15k

* input stage current mirror:

q5 10013 10013 gnd ddnpn
q6 10014 10013 gnd ddnpn

* voltage gain stage & rolloff cap:

q7 10017 10014 gnd ddnpn
c1 10014 10017 15pf

* current mirror source for gain stage:

i1 10002 vs dc 5m
q8 10004 10002 vs ddpnp
q9 10002 10002 vs ddpnp

* Sziklai-connected push-pull output stage:

q10 10018 10017 out ddpnp
q11 10004 10004 10009 ddnpn 100
q12 10009 10009 10017 ddnpn 100
q13 vs 10004 out ddnpn 100
q14 out 10018 gnd ddnpn 100

* generic transistor models generated
* with MicroSim's PARTs utility, using
* default parameters except Bf:

.model ddnpn NPN(Is=10f Xti=3 Eg=1.11 Vaf=100
+ Bf=400 Ise=0 Ne=1.5 Ikf=0 Nk=.5 Xtb=1.5 Var=100
+ Br=1 Isc=0 Nc=2 Ikr=0 Rc=0 Cjc=2p Mjc=.3333
+ Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n
+ Tf=1n Itf=1 Xtf=0 Vtf=10)

.model ddpnp PNP(Is=10f Xti=3 Eg=1.11 Vaf=100
+ Bf=200 Ise=0 Ne=1.5 Ikf=0 Nk=.5 Xtb=1.5 Var=100
+ Br=1 Isc=0 Nc=2 Ikr=0 Rc=0 Cjc=2p Mjc=.3333
+ Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n
+ Tf=1n Itf=1 Xtf=0 Vtf=10)

.ends
*----------end of subcircuit model-----------
 
Last edited:
Why do you simulate a simple circuit that uses an LM386? Simply build the circuit or look at its datasheet instead.
It has a low output power, its distortion is pretty low if it is not clipping and its bandwidth is shown on a graph to be to 300kHz when its gain is 20.
 
In any case, I couldn't get the code to work in Multisim 10, but I don't know how to make things in Multisim effectively.
 
Many people post problems with Multisim because it does not know if it is coming or going. Its schematics are covered in Chicken Pox dots and have wires all over the place.

Most of us use the free sim program LTspice IV from Linear Technology.
 
Hi,

It looks like your opamp was somehow incorrectly specified with the prefix of A instead of X (for subcircuit). Hard to say exactly how this happened off the top of my head, but it should be fairly easy to fix by doing the following:

1. Open the Database Manager (Tools > Database > Database Manager)
2. Go to the user/corporate database, find the LM386 and click Edit
3. In the Model tab, click Show template
4. Change a%p to x%p

That should do the trick!
 
Actually, it was already on x%p.
And it still doesn't work.

Edit:
Hey it works now!

Thanks a lot!
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top