¿ªÔÆÌåÓý

Re: I'm ready to give up LTC all toghether.


 

Gunoi Nare, let me offer my "take" on this.

LTspice's A-devices like the one you used, originally were for LTC's internal use only and not documented at all.? Then Mike made them available for anyone to use and provided minimal documentation, in the Help page for them ("A. Special Functions").

As most of us here in this group know and occasionally discuss, LTspice's Help documentation is and has always been short on details.? We are OK with that because the program that comes with it, is so incredible.? The Help file alone really is not a good way to go from the ground up, to having a solid understanding of how to use LTspice, or SPICE in general.? There are other resources that help fill in the missing pieces.? But there also is a general understanding (partly learned from experience) about how SPICE/LTspice work, which might have prevented this problem that you had.

I think you are correct that many of the Symbols that come built into LTspice, ought to have some parameters already attached to them, so that we don't have to always dig up the documentation or remember which ones we need to add.? That is especially true about the A-devices.? For example, I occasionally use the Modulate (VCO) component, and it doesn't work without the parameters Mark and Space -- so why doesn't LTspice have those two already attached to the symbol before I ever use it?? It's a good question, with no real answer.? That's just the way it is. ?(I suppose Mike might say that the standard library is "clean" with no parameters attached, because attaching parameters is the job of the user, or something like that.)

However, you can edit those symbols!? Just open them in LTspice and attach the parameters yourself, and save them -- ASSUMING that Windows lets you! ?(It might not, if you installed LTspice in the Windows "Program Files" area.) ?Then they will be attached already whenever you use that symbol. ?(This answers your question,?"Is there a way for me to modify the lib so the components would have already some dummy values?") ?I'm not sure if they will last through an LTspice program update, but that's a separate issue.

Now, let's examine why your schematic didn't work.

You defined .PARAMs which you named TRISE and THIGH, and then used them within {braces}.? Using braces converts the user-defined .PARAMs into pure numbers.? So your NAND gate, A1, had the parameters 5.0e-9 and 3.0 attached to it -- but with nothing telling the SPICE engine (internal to LTspice) what they are for.? Think of it this way.? The schematic editor says that you have a NAND gate, with parameters 0.000000005 and 3.0.? And that's all it says.? Once those user-defined .PARAMs have been converted into numbers, everything downstream doesn't know that you named them TRISE or ELEPHANT.

Even if the SPICE engine knew that you named them "TRISE" and "THIGH", it wouldn't help, because user-defined .PARAMs have names that are meaningful only to YOU.? LTspice doesn't (for the most part) care what names you use, and doesn't interpret them. User-defined .PARAM names are your private names.

The NAND gate needs those values given to it as "name=number" pairs.? It needs to see "Trise=5ns" or "Trise=0.000000005" or "Trise={trise}" or "Trise={elephant}.? Otherwise, it doesn't know what to do with the number.

This can be confusing, because SPICE is not 100% consistent about that.? With a resistor, you can use just the resistance value (a number), without having to say "Res=470".? But that pretty much only works with the things that SPICE (40+ years ago) defined that way.? Most other parameters need to have the "name=number" form, when they appear on the device that uses them.

Here's a tip.? In SPICE, if a number must be used in a particular order, then probably it is used as a number alone. ?(Examples: the .TRAN statement, or the PULSE voltage source.) ?If the order doesn't matter, then it must always be used in "name=number" form. ?(Examples: all the values of a .MODEL statement, and all parameters attached to A- and B-elements.)

Andy


Join [email protected] to automatically receive all group messages.