spice help

Discussion in 'General Electronics Chat' started by haditya, Apr 26, 2006.

  1. haditya

    Thread Starter Senior Member

    Jan 19, 2004
    220
    0
    hi
    i m jus learnin spice and i used the aac spice tutorial under references for the same.
    under quirks the author mentions that the .end card must not be followed by any other character or anything..not even a return
    however doing so gives me the .end card missing error in stark contradiction to wat is mentioned on the tutorial
    inserting a character ..linefeed after the .end card causes the programme to work
    alternatively using .op card after .end also gives proper results.

    wat is goin wrong here? i m using spice 2g6 dos version runnin on winxp os.. i type my .cir files in notepad

    also can somone recommend a online source for subcircuits in spice

    thank you
    aditya
     
  2. Papabravo

    Expert

    Feb 24, 2006
    9,898
    1,722
    I'm not sure what is going on with the program you are working with. I can suggest and recommend the free SPICE program from Linear Technology called LTSpice or SwitcherCADIII. It has a nice schematic entry interface, an active support group on Yahoo, and not much in the way of quirky behavior that cannot be explained or fixed with extreme rapidity.

    Try it -- you'' like it!

    As an added bonus you get one-button SMPS designs from a set of voltage and current requirements. The downside -- it only uses LT SMPS parts.
     
  3. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    3
    I've never used the 2g6 under DOS before, but I would think that the quirk mentioned was probably for 2g6 running under some flavour of UNIX. UNIX version is more particular about linefeed, CR and such things. The tutorial does mention that the quirks might not applicable for different versions or different SPICEs. I've used other flavour of SPICE where some of the quirks mentioned were present, such as first line must be a title, node 0 must be present and no open circuit (floating node) allowed but no other.

    Generally, after the .end command, no other line is allowed (but the flavour that I use regularly does allow any number of empty lines). I found that your problem, where it didn't work if nothing was inserted after the .end and worked if there was something after the .end is very peculiar. Could you post both of your netlists (the one that gave an error and the good one)?

    You might want to check the eCircuitCenter site for excellent SPICE tutorials, circuit collections and much much more. You could also download the HSPICE manual here. It has complete references, commands, elements, device models and equations. Some of the elements, commands and models are HSPICE proprietary, but most of them are applicable to other varieties of SPICE.
     
  4. haditya

    Thread Starter Senior Member

    Jan 19, 2004
    220
    0
    thanks for the links.. been to ecircuitcentre before.. yup its got quite a lot on spice..
    heres the netlist with .op added after .end
    Code ( (Unknown Language)):
    1. inverting opamp
    2. v1 1 0 sin (0 1 1000 0 0)
    3. r1 1 2 5k
    4. r2 3 2 10k
    5. rin 2 4 2meg
    6. rbogus 4 0 1m
    7. rout 5 3 75
    8. eog 5 0 4 2 200000
    9. .tran 0.01m 2m
    10. .plot tran v(1,0) v(3,0)
    11. .end
    12. .op
    13.  
    with no return after .end
    Code ( (Unknown Language)):
    1.  
    2. inverting opamp
    3. v1 1 0 sin (0 1 1000 0 0)
    4. r1 1 2 5k
    5. r2 3 2 10k
    6. rin 2 4 2meg
    7. rbogus 4 0 1m
    8. rout 5 3 75
    9. eog 5 0 4 2 200000
    10. .tran 0.01m 2m
    11. .plot tran v(1,0) v(3,0)
    12. .end
    and with linefeed after .end
    Code ( (Unknown Language)):
    1.  
    2. inverting opamp
    3. v1 1 0 sin (0 1 1000 0 0)
    4. r1 1 2 5k
    5. r2 3 2 10k
    6. rin 2 4 2meg
    7. rbogus 4 0 1m
    8. rout 5 3 75
    9. eog 5 0 4 2 200000
    10. .tran 0.01m 2m
    11. .plot tran v(1,0) v(3,0)
    12. .end
    13.  
    14.  
     
  5. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    3
    The only thing that might cause problems, as far as I can see, are the first empty lines on both the error netlists. 2g6 thinks that the title (always first line) as empty and try to interpret the real title (2nd line) as a card. I think 2g6 ignores any lines after the .end, so that might not in itself flags an error.

    What was the error according to the 2g6 output? It might be easier to diagnose the problem if you could redirect the output to a text file and attach it here.
     
Loading...