errors in implementation of mtj_write in ltspice

Thread Starter

rishab@123

Joined Sep 12, 2021
1
Hi,

I'm trying to use the mtj_write spice file I downloaded directly from the cspin.umn., but I keep getting an error that says "Trouble parsing initial condition value for V", where v is one of the inputs to the llg_solver.inc . I tried adding initial conditions to this node, but it didn't fix anything. How do I solve this error? Attached are my spice model files .
 

Attachments

Papabravo

Joined Feb 24, 2006
17,273
How are you getting LTspice to run this collection of sub-circuits? Do you have a schematic file with a ".asc" extension that instantiates any of these sub-circuits?
 

eetech00

Joined Jun 8, 2013
2,646
Hi,

I'm trying to use the mtj_write spice file I downloaded directly from the cspin.umn., but I keep getting an error that says "Trouble parsing initial condition value for V", where v is one of the inputs to the llg_solver.inc . I tried adding initial conditions to this node, but it didn't fix anything. How do I solve this error? Attached are my spice model files .
Hi

I've converted the files to LTspice format.
One file is missing....Resistor.inc.
Files attached below.

You will have to test them.

EDIT: "One file is missing....Resistor.inc." I found the file....attached
EDIT: I've found errors and removed the files. I will re-upload corrected ones in a few minutes.

EDIT: I've attached corrected files. They will run in LTspice. A few .meas statements still have errors but I believe that is related to providing the appropriate parameters. You will have to test with appropriate parameters.
Let me know of errors and I will fix.
 

Attachments

Last edited:

Papabravo

Joined Feb 24, 2006
17,273
Hi

I've converted the files to LTspice format.
One file is missing....Resistor.inc.
Files attached below.

You will have to test them.

EDIT: "One file is missing....Resistor.inc." I found the file....attached
I didn't realize the files required reformatting. I'm sorry, but I am not sure how to run a collection of sub circuit files without a schematic. I was hoping for some guidance from the TS or you on how that might be accomplished. It usually requires a schematic file with an extension of ".asc" and a couple of symbol files with the extension ".asy". The schematic is where the specific spice commands reside.

To the TS, have you ever run an LTspice simulation?
 
Last edited:

eetech00

Joined Jun 8, 2013
2,646
I didn't realize the files required reformatting. I'm sorry, but I am not sure how to run a collection of sub circuit files without a schematic. I was hoping for some guidance from the TS or you on how that might be accomplished. It usually requires a schematic file with an extension of ".asc" and a couple of symbol files with the extension ".asy".
Not necessarily.
A simulation doesn't necessarily need a graphical schematic (.asc) or an .asy file.
All it needs is "spice wiring", models and stimulus. These can be in the form of ascii text containing spice statements.

The schematic is where the specific spice commands reside. Have you ever run an LTspice simulation?
??
I've run hundreds...if not thousands....
 

Papabravo

Joined Feb 24, 2006
17,273
Not necessarily.
A simulation doesn't necessarily need a graphical schematic (.asc) or an .asy file.
All it needs is "spice wiring", models and stimulus. These can be in the form of ascii text containing spice statements.



??
I've run hundreds...if not thousands....
OK, so if I open the files in LTspice it opens them as text files. The syntax highlighting is nice, but this does not appear to be very useful.
How do I run a simulation with them is what I am asking?
In more than 30 years of using LTspice and it's predecessors, I have not had an occasion to do this and I do not feel like searching for an answer.
More simply, where are the spice statements in this collection of subcircuits? Am I supposed to know how to create them from whole cloth?
 

eetech00

Joined Jun 8, 2013
2,646
OK, so if I open the files in LTspice it opens them as text files. The syntax highlighting is nice, but this does not appear to be very useful.
Agreed. But it does sometimes show unsupported characters that don't show in text editors.

How do I run a simulation with them is what I am asking?
In more than 30 years of using LTspice and it's predecessors, I have not had an occasion to do this and I do not feel like searching for an answer.
In LTspice, open the stimulus file "MTJ_write_LT.sp" then click "run".
Voltages and currents can be viewed in the waveform viewer (waveform viewer->view->visible traces).
.meas statement results can be viewed in the log file.

More simply, where are the spice statements in this collection of subcircuits?
There will be a stimulus file. If your familiar with programming languages, like C, you can think of the stimulus file as the "Main" routine and the files containig subcircuits/models involved as "include files" (however, sometimes they are included in the stimulus file). A clue to identifying this file is that it will contain analysis statements like ".tran" or ".op", or measurement statements like ".meas". It can also contain "include" statements that specify files to be included in the simulation.

Thats about all I'll say for know because this discussion can go on forever....

Am I supposed to know how to create them from whole cloth?
I don't know what whole cloth is...
:confused:

Here is a screen shot:

1631465581512.png
 

Papabravo

Joined Feb 24, 2006
17,273
In my defense, there was no "stimulus" file in the initial posts, so maybe I'm forgiven for not knowing that it was needed.
Yes I have been writing C code for 40+ years, and that is why I was asking the questions that I was. Thanks for the condescension!
Like I said I have never had occasion to do it this way and I was trying to help -- obviously to no avail.
One more thing -- where did the TS go?
 
Last edited:

eetech00

Joined Jun 8, 2013
2,646
In my defense, there was no "stimulus" file in the initial posts, so maybe I'm forgiven for not knowing that it was needed.
Yes I have been writing C code for 40+ years, and that is why I was asking the questions that I was. Thanks for the condescension!
:confused:condescension?
I don't understand that statement...all I did was explain some of what you didn't know about spice...
 

Papabravo

Joined Feb 24, 2006
17,273
:confused:condescension?
I don't understand that statement...all I did was explain some of what you didn't know about spice...
No you decided to introduce C programming as a possibly appropriate analogy.
All you did was explain that the TS did not include all of the requisite files. It would be hard to figure out what to do with the files he provided if you did not already know the answer. You did, and I didn't.
 
Top