saving . . . saved Unable to simulate subcircuit has been deleted. Unable to simulate subcircuit has been hidden .
Unable to simulate subcircuit
Title
Question
Dear sir,

I was trying to simulate circuit which have one sub circuit.Simulation was successful.Then i tried to use same sub circuit twice ,ngspice gives an error "doanalyses iteration limit reached ".Please refer following circuit and subcircuits


x1 3 7 8 6 10 2 0 4 8 1 sub1
r4 5 0 r
* 74ls04
* Plotting option vplot8_1
* 74ls32
r3 8 0 r
r2 7 0 r
r1 10 0 r
v3 8 0 5
v2 7 0 5
v1 10 0 5
a1 [10] [10_in] u1adc
a2 10_in 3_out u1
a3 [3_out] [3] u1dac
a4 [7] [7_in] u1adc
a5 7_in 6_out u1
a6 [6_out] [6] u1dac
.model u1 d_inverter
.model u1adc adc_bridge(in_low=0.8 in_high=2.0)
.model u1dac dac_bridge(out_low=0.25 out_high=5.0 out_undef=1.8 t_rise=0.5e-9 t_fall=0.5e-9)
a7 [4] [4_in] u2adc
a8 [2] [2_in] u2adc
a9 [4_in 2_in] 5_out u2
a10 [5_out] [5] u2dac
.model u2 d_or
.model u2adc adc_bridge(in_low=0.8 in_high=2.0)
.model u2dac dac_bridge(out_low=0.25 out_high=5.0 out_undef=1.8 t_rise=0.5e-9 t_fall=0.5e-9)

.tran 1e-03 10e-00 0e-00

* Control Statements
.control
run
plot v(5)
.endc
.end

and contents of sub circuit are

* Subcircuit sub1
.subckt sub1 4 0 7 8 9 1 3 2
* eeschema netlist version 1.1 (spice format) creation date: wednesday 04 june 2014 01:59:31 pm ist
* 74ls08
a1 [7] [7_in] u3adc
a2 [8] [8_in] u3adc
a3 [7_in 8_in] 5_out u3
a4 [5_out] [5] u3dac
a5 [3] [3_in] u3adc
a6 [2] [2_in] u3adc
a7 [3_in 2_in] 10_out u3
a8 [10_out] [10] u3dac
a9 [10] [10_in] u3adc
a10 [11] [11_in] u3adc
a11 [10_in 11_in] 12_out u3
a12 [12_out] [12] u3dac
a13 [5] [5_in] u3adc
a14 [9] [9_in] u3adc
a15 [5_in 9_in] 1_out u3
a16 [1_out] [1] u3dac
.model u3 d_and
.model u3adc adc_bridge(in_low=0.8 in_high=2.0)
.model u3dac dac_bridge(out_low=0.25 out_high=5.0 out_undef=1.8 t_rise=0.5e-9 t_fall=0.5e-9)

.ends sub1

Please do needful.

Regards,
Biren



Oscad Schematic-Creation-and-Simulation None min None sec 04-06-14, 2:43 p.m. Biren

Answers:

I could simulate the netlist with one subcircuit, but I don't know if the answer is correct. By the way, why have you not given resistance values to R1-R4? 
Can you share your project files here?
04-06-14, 3:29 p.m. rakhiwarriar
Also please post your queries on Oscad under the tutorial category 'Oscad', hereafter.
04-06-14, 4:34 p.m. rakhiwarriar

Login to add comment


Dear,

I can simulate circuit with only one instance of sub circuit.When i was trying to simulate another circuit with two instances ngspice gave errors.I am trying to simulate three input nand gate with help of sub circuit so i made a sub circuit.Problem is Ngspice is expecting a subcircuit with 10 nodes or ports in subcircuit.I am not able to assign 9 or 10 port numbers.Port component,available in port spice,has maximum 8 numbers.If i made subcircuit with 10 nodes not able to simulate.I tried it with another way.I made two same subcircuits. Each components are same except circuit name .Ngspice gave an error.

Please find project files in following link.
https://drive.google.com/file/d/0B1w2NuNGLDxJTGdwa1haVjF6OWM/edit?usp=sharing

Thanks for responding quickly.

Regards,
Biren






04-06-14, 7:43 p.m. Biren
You have taken a triple gate IC and created a subcircuit for only one gate. I suggest you do the following:
Option 1:
(1) Choose a single gate IC for the same functionality (If such an IC is not present you can create one using the library editor)
(2) Make the subcircuit for this IC (you have already created this - just link it to this new IC)
(3) If you want to have DC supply voltage in your circuit, you should use "DC" from sourcesSpice.
        OR
Option 2:
Define subcircuits for all the gates in the IC.


05-06-14, 6:30 p.m. rakhiwarriar

Login to add comment


Dear Rakhi,

First option works well for me.I solved that problem.is there any way to simulate a subcircuit with more then 8 ports?.It would be helpful to me design whole ic packages for different 74 series.

Thank you very much for prompt reply.
08-06-14, 10:27 p.m. Biren


Log-in to answer to this question.