LTSpice Error "Too many parameters for subcircuit type"

Discussion in 'Electronics Resources' started by Biju P, Aug 17, 2008.

  1. Biju P

    Thread Starter New Member

    Aug 17, 2008
    1
    0
    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
     
  2. Ratch

    New Member

    Mar 20, 2007
    1,068
    3
    Biju P,

    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
     
  3. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Your Spiceorder is wrong in the .asy file. See below for corrections.
    Code ( (Unknown Language)):
    1. Version 4
    2. SymbolType CELL
    3. LINE Normal -32 32 32 64
    4. LINE Normal -32 96 32 64
    5. LINE Normal -32 32 -32 96
    6. LINE Normal -28 48 -20 48
    7. LINE Normal -28 80 -20 80
    8. LINE Normal -24 84 -24 76
    9. LINE Normal 0 32 0 48
    10. LINE Normal 0 96 0 80
    11. LINE Normal 4 44 12 44
    12. LINE Normal 8 40 8 48
    13. LINE Normal 4 84 12 84
    14. WINDOW 0 16 32 Left 0
    15. WINDOW 3 16 96 Left 0
    16. SYMATTR Value lmv324
    17. SYMATTR Prefix X
    18. 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.
    19. SYMATTR SpiceModel lmv324
    20. SYMATTR ModelFile LMV324.MOD
    21. PIN -32 48 NONE 0
    22. PINATTR PinName In-
    23. PINATTR SpiceOrder 2
    24. PIN -32 80 NONE 0
    25. PINATTR PinName In+
    26. PINATTR SpiceOrder 1
    27. PIN 0 32 NONE 0
    28. PINATTR PinName V+
    29. PINATTR SpiceOrder 3
    30. PIN 0 96 NONE 0
    31. PINATTR PinName V-
    32. PINATTR SpiceOrder 4
    33. PIN 32 64 NONE 0
    34. PINATTR PinName OUT
    35. PINATTR SpiceOrder 5
    36.  
    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:
    Code ( (Unknown Language)):
    1. .SUBCKT  lmv324     3  2  4  5  6
     
  4. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    So, the SpiceOrder needs to be one less than on the .SUBCKT line? :confused:
     
  5. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    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:
    Code ( (Unknown Language)):
    1. * Connections       non-inverting input
    2. *                   |  inverting input
    3. *                   |  |  positive power supply
    4. *                   |  |  |  negative power supply
    5. *                   |  |  |  |  output
    6. *                   |  |  |  |  |
    7. .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:
    Code ( (Unknown Language)):
    1. PINATTR PinName In-
    2. PINATTR SpiceOrder 2
    3. PIN -32 80 NONE 0
    4. PINATTR PinName In+
    5. PINATTR SpiceOrder 1
    6. PIN 0 32 NONE 0
    7. PINATTR PinName V+
    8. PINATTR SpiceOrder 3
    9. PIN 0 96 NONE 0
    10. PINATTR PinName V-
    11. PINATTR SpiceOrder 4
    12. PIN 32 64 NONE 0
    13. PINATTR PinName OUT
    14. PINATTR SpiceOrder 5
    15.  
    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.:(
     
  6. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Looks like Biju P is another drive-by poster. :mad:
    It would be nice to get some feedback.
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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 :)
     
  8. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    You're welcome.:)
     
  9. azgreenb

    New Member

    Sep 18, 2008
    6
    0
    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
     
  10. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Azgreenb, you need to elaborate. I don't know what you are asking, or why.
     
  11. azgreenb

    New Member

    Sep 18, 2008
    6
    0
    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?
     
  12. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    I don't do Multisim, but the node#/pin name equivalence is specified by these two lines in the subcircuit file:
    Code ( (Unknown Language)):
    1. .subckt MIC4421 4  3   9   2
    2. *               In Out Vcc Gnd
     
  13. azgreenb

    New Member

    Sep 18, 2008
    6
    0
    Would you know if the file is correct? Could you explain the node 9 on an 8 pin device?
     
  14. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    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.
     
  15. azgreenb

    New Member

    Sep 18, 2008
    6
    0
    Thank you...
     
Loading...