0
\$\begingroup\$

I wanted to learn to use SPICE through text files, (no GUI except for notepad/notepad++) but I am not capable of setting this up myself. I found some spice2/spice3 downloads from Berkeley's but that's about as far as I get. I know that I need to run "spice < myCircuit.cir" in cmd, but it is an unrecognized function. I have tried all day with Visual Studio and some strange things I gathered from searching the internet, but no success.

Oh, and I am using Windows 10.

To make things more clear, I was following this walkthrough https://www.allaboutcircuits.com/textbook/reference/chpt-7/fundamentals-spice-programming/ but failed miserably. In the link, beneath the example CMD line "spice < example.cir" it mentions "(providing that the SPICE software has been installed on the computer!)." The walkthrough doesn't mention how to install, so this is where I depart onto various internet threads and I haven't found a working installation procedure.

\$\endgroup\$
7
  • \$\begingroup\$ I edited my post to include a link as to illuminate what I want to do. \$\endgroup\$
    – Sheepwall
    Commented Aug 9, 2017 at 21:04
  • 1
    \$\begingroup\$ I edited my post to (I hope) answer your question. \$\endgroup\$
    – Sheepwall
    Commented Aug 9, 2017 at 21:17
  • 2
    \$\begingroup\$ This might be a better fit on Super User; it's not so much an electronics question - more of a 'how do I get program X running' which is sort of off-topic. \$\endgroup\$ Commented Aug 9, 2017 at 21:17
  • 2
    \$\begingroup\$ Aside: many people here use LTspice as a freeware SPICE simulator - it's a Windows-native program and works well. \$\endgroup\$ Commented Aug 9, 2017 at 21:21
  • 1
    \$\begingroup\$ @KingDuken No, he's asking how to make Berkely SPICE work on his PC, because he cannot even launch it. That's why I think the post should move to SuperUser. Once he makes it work, asking about it would be more on-topic. \$\endgroup\$ Commented Aug 10, 2017 at 0:00

2 Answers 2

1
\$\begingroup\$

You can download LTspice which has a GUI but run it from the command line:

scad3.exe -b example.cir

-b: Run in batch mode. E.g. "scad3.exe -b deck.cir" will leave the data in file deck.raw

\$\endgroup\$
1
  • \$\begingroup\$ In addition to that, you can open *.cir (or *.net) files just fine and it will look like a syntax coloured circuit/netlist. \$\endgroup\$ Commented Aug 10, 2017 at 5:37
0
\$\begingroup\$

spice being an unrecognized function most probably means either the command has a different name, or you (and the installer) forgot to add it to the PATH.

First, go to the folder where you installed SPICE, and check what executable files are there. The name of the command you type in the command prompt must exactly match the executable file name (the .exe part is optional).

If you have found spice.exe, but the command you mention still fails, you have two options:

(1) Run the command mentioning the path to the executable file:

c:\programs\spice3\spice < myCircuit.cir

(2) Add the folder where the executable file lives to the PATH:

setx Path "%Path%;c:\programs\spice3"
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.