LTSpice Error "Too many parameters for subcircuit type"

Thread Starter

Biju P

Joined Aug 17, 2008
1
Hi All,

I am using LTSpice for simulating Analog Circuits ,I have created a symbol for LMV324 using the model file LMV324.MOD downloaded from National Semiconductor web site,while trying to simulate using this model i am getting an error
"Too many parameters for subcircuit type "lmv324" (instance: xu1)"

Please find the attached model file and subcircuit symbol.

Thanks,
Biju P
 

Attachments

Ratch

Joined Mar 20, 2007
1,070
Biju P,

Please find the attached model file and subcircuit symbol.
What are we supposed to do with what you sent? How do we know what you did to get that error? You need to describe in detail what you did.

Ratch
 

Ron H

Joined Apr 14, 2005
7,063
Your Spiceorder is wrong in the .asy file. See below for corrections.
Rich (BB code):
Version 4
SymbolType CELL
LINE Normal -32 32 32 64
LINE Normal -32 96 32 64
LINE Normal -32 32 -32 96
LINE Normal -28 48 -20 48
LINE Normal -28 80 -20 80
LINE Normal -24 84 -24 76
LINE Normal 0 32 0 48
LINE Normal 0 96 0 80
LINE Normal 4 44 12 44
LINE Normal 8 40 8 48
LINE Normal 4 84 12 84
WINDOW 0 16 32 Left 0
WINDOW 3 16 96 Left 0
SYMATTR Value lmv324
SYMATTR Prefix X
SYMATTR Description Basic Operational Amplifier symbol for use with subcircuits in the file ./lib/sub/LTC.lib.  You must give the value a name and include this file.
SYMATTR SpiceModel lmv324
SYMATTR ModelFile LMV324.MOD
PIN -32 48 NONE 0
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN -32 80 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 1
PIN 0 32 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 3
PIN 0 96 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 32 64 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5
Spiceorder has nothing to do with pin names or numbers. It has everything to do with the order of the pins in the .subckt line of your model file:
Rich (BB code):
.SUBCKT  lmv324     3  2  4  5  6
 

Ron H

Joined Apr 14, 2005
7,063
So, the SpiceOrder needs to be one less than on the .SUBCKT line? :confused:
No. If a device has N pins that are used for I/O and power, then the Spiceorder must start with 1 and end with N. The LMV324 has 5 pins, so the Spiceorder goes from 1 to 5.
The subcircuit in the model file is a netlist of the circuit that represents the device. Each pin and internal node is assigned an arbitrary number or name. In this case, the engineer decided on the following node numbers for the I/O and power pins:
Rich (BB code):
* Connections       non-inverting input
*                   |  inverting input
*                   |  |  positive power supply 
*                   |  |  |  negative power supply 
*                   |  |  |  |  output 
*                   |  |  |  |  |
.SUBCKT  lmv324     3  2  4  5  6
They are placed in this order because the package pins are defined in the .asy file (which "draws" the symbol) as below:
Rich (BB code):
PINATTR PinName In-
PINATTR SpiceOrder 2
PIN -32 80 NONE 0
PINATTR PinName In+
PINATTR SpiceOrder 1
PIN 0 32 NONE 0
PINATTR PinName V+
PINATTR SpiceOrder 3
PIN 0 96 NONE 0
PINATTR PinName V-
PINATTR SpiceOrder 4
PIN 32 64 NONE 0
PINATTR PinName OUT
PINATTR SpiceOrder 5
Note that the Spiceorder can be in any order :rolleyes:, just so long as 1-5 are all present.

Remember, the subckt nodes, which were numbered 2, 3, 4, 5, 6, could have been called joe, bob, bill, ron, and wookie. So long as these were listed in the correct order in the .subckt line, the model and .asy file would still work together.

I guess that was about as clear as mud.:(
 

SgtWookie

Joined Jul 17, 2007
22,230
Actually, I'm sorry I didn't thank you for your response for my question.
That was quite lucid, and did in fact answer my question. Thanks :)
 

azgreenb

Joined Sep 18, 2008
6
Trying to use the following "spice" file. After reading the post I realized I have no idea how the nodes are called out in this driver. There are only 8 pins. Any help is appreciated.



* Micrel MIC4421
*
* This model was developed for Micrel by:
* AEI Systems, LLC
* 5777 W. Century Blvd. Suite 876
* Los Angeles, California 90045
* Copyright 2005, all rights reserved.
*
* This model is subject to change without notice.
* Users may not directly or indirectly re-sell or
* re-distribute this model.
*
* For more information regarding modeling services,
* model libraries and simulation products, please
* call AEi Systems at (310) 216-1144, or contact
* AEi by email: info@aeng.com. http://www.AENG.com
*
* Revision: 3/1/05, version 1.1

.subckt MIC4421 4 3 9 2
* In Out Vcc Gnd
Rin 4 Vind 2k
C1 4 2 6P
D2 2 Vind DN
D3 4 9 DN
RT 4 2 10MEG

Vsctl 13 0 DC=5
XSctl 13 VindH Vind 2 SWhyste PARAMS: VT=1.2 VH=.1 RON=1 ROFF=1G
Rsctl VindH 2 1MEG

I2 9 2 DC=50u
R2 9 2 600k
I1 9 8 DC=215U
R4 9 8 150k
D4 8 9 DN
.MODEL DN D

EBLin 12 2 Value={ IF ( V(VindH) > 2 , 5 , 0 ) }
Rind 12 10 100
Cind 10 11 85p
Vinput 11 2
GBind 10 2 Value={ IF ( 13.25-V(9) > 0 , 0.3*I(Vinput)*(13.25-V(9)) , 0 ) }
XSinput 8 6 10 2 SWhyste PARAMS: VT=1.9 VH=.65 RON=1 ROFF=1G
Rinput 6 2 6k

EB3 7 3 Value={ IF ( V(8,2) < 0.5*V(9,2) , V(9,2) , -V(9,2) ) }
Rout 1 7 550

EVS 99 0 Value={ IF ( V(9)-4 < 1 , 1 , V(9)-4 ) }
XCout 99 0 98 1 2 yx
* Ctl Ref Cap+ -
Cref 98 0 1p
C2 3 2 1000p
M4 9 1 3 3 _M4_mod L=1U W=9.88U
M5 2 1 3 3 _M5_mod L=1U W=7.296U
.MODEL _M5_mod PMOS KP=67m RD=.655 VTO=-1.838
.MODEL _M4_mod NMOS KP=35m RD=.428 VTO=1.283
.ENDS
.subckt yx 1 2 3 4 5
ecopy 3 6 poly(2) (1,2) (4,5) 0 0 0 0 1
fout 4 5 vsense 1
rin 1 2 1G
vsense 0 6 0
.ends
.subckt SWhyste NodeMinus NodePlus Plus Minus PARAMS: RON=1 ROFF=100MEG VT=1.5 VH=.5
S5 NodePlus NodeMinus 8 0 smoothSW
EBcrtl 8 0 Value = { IF ( V(plus)-V(minus) > V(ref), 1, 0 ) }
EBref ref1 0 Value = { IF ( V(8) > 0.5, {VT-VH}, {VT+VH} ) }
Rdel ref1 ref 70
Cdel ref 0 100p IC={VT+VH}
Rconv1 8 0 10Meg
Rconv2 plus 0 10Meg
Rconv3 minus 0 10Meg
.model smoothSW VSWITCH (RON={RON} ROFF={ROFF} VON=1 VOFF=0)
.ends SWhyste
 

azgreenb

Joined Sep 18, 2008
6
Sorry, trying to import the above spice file to create my first symbol in Mulitsim 9. I have gone through the component wizard, created the symbol etc... On the last step when it asks to assign the pins to the nodes, I get stumped. It calls out node 9 in the file but only 8 pins. I don't have an option for node 9. Also this device has two GND and Vcc pins each. How would separate pins be specified with the same node?
 

Ron H

Joined Apr 14, 2005
7,063
Sorry, trying to import the above spice file to create my first symbol in Mulitsim 9. I have gone through the component wizard, created the symbol etc... On the last step when it asks to assign the pins to the nodes, I get stumped. It calls out node 9 in the file but only 8 pins. I don't have an option for node 9. Also this device has two GND and Vcc pins each. How would separate pins be specified with the same node?
I don't do Multisim, but the node#/pin name equivalence is specified by these two lines in the subcircuit file:
Rich (BB code):
.subckt MIC4421 4  3   9   2 
*               In Out Vcc Gnd
 

Ron H

Joined Apr 14, 2005
7,063
Would you know if the file is correct? Could you explain the node 9 on an 8 pin device?
Hmmm, I thought I answered this. I must have forgotten to post it.
I don't know if the file is correct.
Practically every IC has more internal nodes than it has pins. Look at the schematic for the LM555 timer below. It has at least 20 internal nodes (circled). A subcircuit for this would have to have all these nodes, as well as the pins.
Furthermore, there is no significance to the actual number of a node. In a subcircuit, node numbers do not have to be sequential. In fact, they don't even have to be numbers. If I had a hypothetical subcircuit with 4 nodes, they could be numbered 1, 2, 3, 4, or 103, 271, 195, 9. They could even be called joe, 17af3, bill, enac, and the subcircuit would perform the same in all cases.
 

Attachments

Top