What is wrong with my spice .subckt

Discussion in 'Electronics Resources' started by upopads, Dec 11, 2012.

  1. upopads

    Thread Starter Active Member

    Dec 18, 2007
    42
    0
    Anyone fluent in spice know exactly what is wrong with this code?

    When I go to run in Altium I get an error saying "too many parameters for subcircuit type"

    I know my problem has to lie with the op amp code. The compiler focuses on
    the .subckt line if that means anything.

    Code ( (Unknown Language)):
    1.  
    2. .subckt AD8603 1 2 99 50 45
    3. M1 14 7 8 8 PIX L=1E-6 W=42E-6
    4. M2 16 2 8 8 PIX L=1E-6 W=42E-6
    5. M3 17 7 10 10 NIX L=1E-6 W=42E-6
    6. M4 18 2 10 10 NIX L=1E-6 W=42E-6
    7. RC5 14 50 1E+5
    8. RC6 16 50 1E+5
    9. RC7 99 17 1E+5
    10. RC8 99 18 1E+5
    11. C1 14 16 0.8E-12
    12. C2 17 18 0.8E-12
    13. I1 99 8 4E-6
    14. I2 10 50 4E-6
    15. V1 99  9 0.3
    16. V2 13 50 0.3
    17. D1 8 9 DX
    18. D2 13 10 DX
    19. EOS 7 1 POLY(3) (22,98) (73,98) (81,98) 40E-6 1 1 1
    20. IOS 1 2 0.05E-12
    21. * CMRR 90dB, ZERO AT 15kHz, POLE AT 2MHz
    22. ECM1 21 98 POLY(2) (1,98) (2,98) 0 0.5 0.5
    23. CCM1 21 22 3.54E-10
    24. RCM1 21 22 30000
    25. RCM2 22 98 1
    26. * PSRR=100dB, ZERO AT 300Hz
    27. EPSY 98 72 POLY(1) (99,50) 0 1
    28. CPS3 72 73 5.30E-9
    29. RPS3 72 73 100E+3
    30. RPS4 73 98 1
    31. * VOLTAGE NOISE REFERENCE OF 20nV/rt(Hz)
    32. VN1 80 98 0
    33. RN1 80 98 16.45E-3
    34. HN  81 98 VN1 20
    35. RN2 81 98 1
    36. * INTERNAL VOLTAGE REFERENCE
    37. EREF 98  0 POLY(2) (99,0) (50,0) 0 .5 .5
    38. GSY  99 50 (99,50) 1.9E-6
    39. EVP  97 98 POLY(1) (99,50) -0.6 0.5
    40. EVN  51 98 POLY(1) (50,99) 0.6 0.5
    41. * GAIN STAGE
    42. G1 98 30 POLY(2) (14,16) (17,18) 0 1.25E-5 1.25E-5
    43. R1 30 98 4.69e7
    44. CF 45 30 50E-12
    45. D3 30 97 DX
    46. D4 51 30 DX
    47. * OUTPUT STAGE
    48. M5 45 46 99 99 POX L=1E-6 W=1.61E-3
    49. M6 45 47 50 50 NOX L=1E-6 W=2.15E-3
    50. EG1 99 46 POLY(1) (98,30) 0.3778 1
    51. EG2 47 50 POLY(1) (30,98) 0.3771 1
    52. * MODELS
    53. .MODEL POX PMOS (LEVEL=2,KP=10E-6,VTO=-0.328,LAMBDA=0.01,RD=0)
    54. .MODEL NOX NMOS (LEVEL=2,KP=10E-6,VTO=+0.328,LAMBDA=0.01,RD=0)
    55. .MODEL PIX PMOS
    56. + (LEVEL=2,KP=10E-6,VTO=-0.328,LAMBDA=0.01,Kf=10E-35,AF=1,TOX=100E-3)
    57. .MODEL NIX NMOS
    58. + (LEVEL=2,KP=10E-6,VTO=+0.328,LAMBDA=0.01,KF=10E-35,AF=1,TOX=100E-3)
    59. .MODEL DX D(IS=1E-14,RS=5)
    60. .ENDS AD8603
    61.  
     
    Last edited: Dec 11, 2012
  2. JoeJester

    AAC Fanatic!

    Apr 26, 2005
    3,373
    1,159
    I tend to think there is nothing wrong with your code as your code works fine in my simulator. It's exactly like the model downloaded from the manufacturer's website ... only your's doesn't have the comments before the .subckt line.

    Are you adding the model to your library properly? Read : http://wiki.altium.com/display/ADOH/Linking+a+Simulation+Model+to+a+Schematic+Component

    Maybe your pin assignment isn't correct in the library description file.

    That is not a "circuit", it's just the model subcircuit.

    http://www.newelectronics.co.uk/ele...ing-spice-and-pspice-simulation-models/44750/
     
    Last edited: Dec 12, 2012
  3. WBahn

    Moderator

    Mar 31, 2012
    17,754
    4,799
    Following up on JoeJester's point, are you trying to run the above file? If so, then you have no circuit defined. What does it mean to run an opamp that is just sitting on the table not connected to anything? I don't know. And your simulator doesn't know, either. But how the simulator conveys that information to you may not be very clear. So perhaps what you are seeing is just how it responds to that situation.
     
  4. upopads

    Thread Starter Active Member

    Dec 18, 2007
    42
    0
    Jester and ban thanks I was able to fix on my own, it turned out the mistake was related to my power nets having different labels on my op amp schematic. A mistake nobody here would have even been able to catch without supplying my design.

    I appreciate the help though! Really should try to contribute more to this board instead of mooch off it.
     
  5. upopads

    Thread Starter Active Member

    Dec 18, 2007
    42
    0
    D= yea exactly i ran an op amp not connecting to anything sitting on a table.
     
Loading...