Problem while designing LM386

I am not getting correct when I created square wave oscillator using Lm386 .I have designed my own subcircuit for lm386 and later I tested it for square wave oscillator.
I am attaching the cir.out files of lm386 subcircuit and square wave oscillator.
Please somebody help me how to resolve it.

LM386 cir.out file

  • c:\users\bhargav\esim\src\subcircuitlibrary\lm386\lm386.cir
    .include PNP.lib

.include D.lib

.include NPN.lib

d2 /16 /14 1N4148

r3 /7 /11 15k

r4 /8 /11 150

r5 /1 /8 1.35k

r6 /5 /1 15k

q2 /10 /9 /11 Q2N2907A

q1 /4 /2 /9 Q2N2907A

r1 /2 /4 50k

q3 /10 /10 /4 Q2N2222

q4 /12 /10 /4 Q2N2222

q5 /12 /13 /1 Q2N2907A

q6 /4 /3 /13 Q2N2907A

r7 /3 /4 50k

q7 /14 /12 /4 Q2N2222

q8 /15 /14 /5 Q2N2907A

q10 /5 /15 /4 Q2N2222

d1 /17 /16 1N4148

q9 /6 /17 /5 Q2N2222

  • u1 /1 /2 /3 /4 /5 /6 /7 /8 port

r2 /6 /7 15k

i1 /17 /6 dc 4m

.tran 0e-00 0e-00 0e-00

  • Control Statements

.control

run

print allv > plot_data_v.txt

print alli > plot_data_i.txt

.endc

.end

square wave oscillator file

.include lm386.sub
x1 /1 /2 /3 gnd /5 /6 ? /1 lm386
r2 /3 out 10k
r1 /3 gnd 1k
r3 /2 out 100k
r4 out gnd 8
v1 /6 gnd 6

  • u1 out plot_v1
    c2 /5 out 50u
    c1 /2 gnd 0.1u
    .tran 100e-06 100e-03 0e-03

  • Control Statements
    .control
    run
    print allv > plot_data_v.txt
    print alli > plot_data_i.txt
    plot v(out)
    .endc
    .end

Please edit your post! If you want to show code (e.g. inputs and outputs from ngspice), put ~~~ (three times the tilde) at the beginning of a new line in front of and after the code. Otherwise it is relatively unreadable.

Example

r1 /3 gnd 1k
r3 /2 out 100k
r4 out gnd 8
v1 /6 gnd 6

of a code snippet.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.