¿ªÔÆÌåÓý


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

On Mon, May 5, 2025 at 03:30 PM, John Woodgate wrote:

I've never heard of that procedure. Let's see what others say.

It was OK.? But it probably was not clear exactly what was going on, at first glance.? We are so accustomed to seeing only top-level schematics that we forget there are other kinds, in LTspice-land.
?
Per's .ASC schematic file is a lower-level hierarchical schematic.? It is not meant to be run by itself.? It is meant to be "called" by a higher-level schematic.
?
The .ASY symbol file that accompanies it is the symbol that represents that lower-level schematic.? Symbols for lower-level blocks are supposed to have no Attributes, no simulation commands, and maybe no power supplies.? In that regard, everything appears to have been done correctly.
?
Andy
?
?


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

On Mon, May 5, 2025 at 01:03 PM, Per wrote:
I want to do something like add MOS=IPB107N20N3 in the PARAMS section on the Navigate/Edit Schematic Block but it moans at me about not being able to resolve the parameter.
Then it appears you know how to add .PARAMs to your symbol already.? That wasn't clear, because the uploaded symbol does not have any parameters added to it yet.
?
However, if you are using anything before the latest versions of LTspice, parameter values must be numeric only, so attempting to do a parameter assignment "MOS=IPB107N20N3" will fail, unless IPB107N20N3 is another parameter whose value is numeric.? The rest of this message is for people who are not running the latest version of LTspice.
?
You can still use PARAMs to change or set the model of a transistor, by defining the transistor models with numeric names.? For example:
?
.SUBCKT IPB107N20N3_L0 drain gate source ...
...
.ENDS
...
.SUBCKT AnotherFET drain gate source
...
.ENDS
?
.model 1 AKO: IPB107N20N3_L0
.model 2 AKO: AnotherFET
.model 3 AKO: ...
...
.PARAM MOS=1
?
But don't forget that both NMOS symbols inside your "bimos.asc" schematic must have their Prefix values changed from "MN" to "X", to make them work with that Infineon SPICE model which is a .SUBCKT model.? Also, if you use the Infineon model named just "IPB107N20N3", that model requires a special MOSFET symbol with 5 pins.? I hope you are aware of how those models are supposed to work.
?
Andy
?
?


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

¿ªÔÆÌåÓý

Well, I now have 24.1.8, but the Help still says: The enclosed expression will be replaced with the floating-point value.

On 2025-05-05 22:24, John Woodgate wrote:

OK, so it's MY Help that needs to be updated. I will see.

On 2025-05-05 22:02, Mathias Born via groups.io wrote:
It's already in there. In great detail.
?
On Mon, May 5, 2025 at 10:36 PM, John Woodgate wrote:

So the Help needs to be updated, ASAP.

On 2025-05-05 20:37, Mathias Born via groups.io wrote:
Not quite. LTspice also knows string parameters, which were introduced extactly for the purpose discussed here.
?
Best Regards,
Mathias
?
On Mon, May 5, 2025 at 07:16 PM, John Woodgate wrote:

.PARAM can only be used to pass numbers. From the Help: To invoke parameter substitution and expression evaluation, enclose the expression in curly braces. The enclosed expression will be replaced with the floating-point value.

--
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

¿ªÔÆÌåÓý

OK, so it's MY Help that needs to be updated. I will see.

On 2025-05-05 22:02, Mathias Born via groups.io wrote:
It's already in there. In great detail.
?
On Mon, May 5, 2025 at 10:36 PM, John Woodgate wrote:

So the Help needs to be updated, ASAP.

On 2025-05-05 20:37, Mathias Born via groups.io wrote:
Not quite. LTspice also knows string parameters, which were introduced extactly for the purpose discussed here.
?
Best Regards,
Mathias
?
On Mon, May 5, 2025 at 07:16 PM, John Woodgate wrote:

.PARAM can only be used to pass numbers. From the Help: To invoke parameter substitution and expression evaluation, enclose the expression in curly braces. The enclosed expression will be replaced with the floating-point value.

--
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

It's already in there. In great detail.
?
On Mon, May 5, 2025 at 10:36 PM, John Woodgate wrote:

So the Help needs to be updated, ASAP.

On 2025-05-05 20:37, Mathias Born via groups.io wrote:
Not quite. LTspice also knows string parameters, which were introduced extactly for the purpose discussed here.
?
Best Regards,
Mathias
?
On Mon, May 5, 2025 at 07:16 PM, John Woodgate wrote:

.PARAM can only be used to pass numbers. From the Help: To invoke parameter substitution and expression evaluation, enclose the expression in curly braces. The enclosed expression will be replaced with the floating-point value.

--


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

¿ªÔÆÌåÓý

So the Help needs to be updated, ASAP.

On 2025-05-05 20:37, Mathias Born via groups.io wrote:
Not quite. LTspice also knows string parameters, which were introduced extactly for the purpose discussed here.
?
Best Regards,
Mathias
?
On Mon, May 5, 2025 at 07:16 PM, John Woodgate wrote:

.PARAM can only be used to pass numbers. From the Help: To invoke parameter substitution and expression evaluation, enclose the expression in curly braces. The enclosed expression will be replaced with the floating-point value.

--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

¿ªÔÆÌåÓý

NOW It does, but not all are running the latest version(s)

?

From: [email protected] <[email protected]> On Behalf Of Mathias Born via groups.io
Sent: Monday, May 05, 2025 12:38 PM
To: [email protected]
Subject: EXTERNAL: Re: [LTspice] Passing a Mosfet Value as a parameter to a hierarchical subcircuit

?

Not quite. LTspice also knows string parameters, which were introduced extactly for the purpose discussed here.

?

Best Regards,

Mathias

?

On Mon, May 5, 2025 at 07:16 PM, John Woodgate wrote:

.PARAM can only be used to pass numbers. From the Help: To invoke parameter substitution and expression evaluation, enclose the expression in curly braces. The enclosed expression will be replaced with the floating-point value.


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

Not quite. LTspice also knows string parameters, which were introduced extactly for the purpose discussed here.
?
Best Regards,
Mathias
?
On Mon, May 5, 2025 at 07:16 PM, John Woodgate wrote:

.PARAM can only be used to pass numbers. From the Help: To invoke parameter substitution and expression evaluation, enclose the expression in curly braces. The enclosed expression will be replaced with the floating-point value.


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

¿ªÔÆÌåÓý

I've never heard of that procedure. Let's see what others say.

On 2025-05-05 20:22, Per wrote:
Thanks for the reply. That's a big not going to happen then. :-(
?
As an aside the .asc file is 'linked' to the .asy file. It does not need a simulation directive. You drop the .asy on the schematic and off you, don't, go. Yes you could have internal supplies but otherwise you would link them in hopefully with net labels or pins/ports.
?
Either I am wrong or I think you know that one.
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

Thanks for the reply. That's a big not going to happen then. :-(
?
As an aside the .asc file is 'linked' to the .asy file. It does not need a simulation directive. You drop the .asy on the schematic and off you, don't, go. Yes you could have internal supplies but otherwise you would link them in hopefully with net labels or pins/ports.
?
Either I am wrong or I think you know that one.


Re: Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

¿ªÔÆÌåÓý

.PARAM can only be used to pass numbers. From the Help: To invoke parameter substitution and expression evaluation, enclose the expression in curly braces. The enclosed expression will be replaced with the floating-point value.

Your .ASC is incomplete, anyway. There are no supply voltages and no simulation directive. Your.ASY has no attributes. Maybe that is OK, but maybe not.

On 2025-05-05 18:03, Per wrote:
Hi,
?
I want to make my own block for a bidirectional mosfet. I can set up the .asc file with two mosfets in it and draw the .asy file.
?
I want to do something like add MOS=IPB107N20N3 in the PARAMS section on the Navigate/Edit Schematic Block but it moans at me about not being able to resolve the parameter.
?
.asc and .asy file, hopefully, in the temp directory in a bit as bimos.zip
?
Thanks for any help.
?
Per
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.


Passing a Mosfet Value as a parameter to a hierarchical subcircuit

 

Hi,
?
I want to make my own block for a bidirectional mosfet. I can set up the .asc file with two mosfets in it and draw the .asy file.
?
I want to do something like add MOS=IPB107N20N3 in the PARAMS section on the Navigate/Edit Schematic Block but it moans at me about not being able to resolve the parameter.
?
.asc and .asy file, hopefully, in the temp directory in a bit as bimos.zip
?
Thanks for any help.
?
Per


Re: OPA square wave generator, single supply OPA is not working

 

I uploaded "LT1006 oscillator.zip" to the Temp folder.? It has three schematics:
?
  • "Original (corrupt!).asc" is the original schematic that wai wai attached to a message.? It is corrupt, probably because it was attached to a message.
  • "Fixed the corrupt values.asc" is the same except that I substituted the "mu" or "micro" character (?) for each instance of the corrupt character, hopefully restoring the original values.
  • "Just the fixed oscillator.asc" is the same schematic but with the three other op-amps and all their unrelated circuitry removed, and with one change to the oscillator's biasing, which makes it oscillate with either dual or single supplies.
?
Why was the original file corrupt?? (Sorry, long story ahead.)? LTspice uses the Greek letter "mu" (?) to mean micro.? By default, if you have a capacitor, inductor, or resistor with a value in micro-anything - even if you physically type a "u" - LTspice converts it to a mu (?).? (You can disable that if you like, in the Settings / Control Panel.)? That letter is represented by the single byte hex B5 (0xB5).? Some may think of it as if it was part of the ASCII character set, but it is not.? PCs with MS-Windows knew 0xB5 meant "?".
?
All is well if those schematics stay within LTspice, and move to and from your computer's drive and most other drives.? But if you take the actual text code (of an LTspice .ASC schematic file) and open it or copy-and-paste it into a text editor, bad things might happen to it.? Some editors preserve it.? Others do not; they notice it is a non-ASCII character and attempt to convert it into something else, which might be either one or two bytes.? We saw that a lot before 2020 when this group was hosted on Yahoo!Groups, because Yahoo's editor would corrupt those bytes if anyone ever edited an LTspice schematic file that had been previously uploaded.
?
In this particular case, when wai wai copied-and-pasted the contents of their original schematic file into their message for the group, those characters found themselves converted from ? to Ϥ and they were now corrupt and not recognized by LTspice.? (That is one of the reasons why you should never ever paste a schematic file into your messages in this group!)? I think LTspice interpreted the "1Ϥ" capacitor as a 1 (Farad) capacitor.? And similarly for the others.? Like all good SPICE programs, unrecognized multipliers are ignored.
?
In the second file inside the .ZIP, I fixed those corrupt values.? I assumed that all six bad values were supposed to be microfarads.
?
Most of the circuitry on that schematic was entirely unrelated to wai wai's question about the oscillator.? So I deleted it.? The third schematic has just the oscillator, with one small change so that it oscillates with either dual or single supplies.
?
Andy
?
?


Re: OPA square wave generator, single supply OPA is not working

 

On Sun, May 4, 2025 at 04:11 AM, wai wai wrote:
LT1006 was a single supply OPA. Trying and gathered no output when single supply was used. welcome any hints or experience would be share, thanks.
Suggestion:
?
Connect the bottom end of R7, to a voltage which is between VEE and VCC.? That allows the voltage across the capacitor to ramp above and below that voltage.
?
By connecting the bottom end of R7 to VEE itself (to a grounded negative supply), the voltage across the capacitor is unable to swing to both sides of it, which is necessary for it to oscillate.
?
Andy
?


Re: Crystal oscillator oscillation startup

 

On Sun, May 4, 2025 at 10:46 AM, Cheng Fei Phung wrote:
May I ask how to resolve the issue for floating node N004 ?
You might not need to, since LTspice resolves that problem for you, by connecting a 1T resistor (GFLOAT) from that net to ground.? Note that the message is a Warning, not an Error, and it fixes it and proceeds with the simulation.
?
If 1 Tohms is not big enough, you can change the value of GFLOAT (.options GFLOAT=1e-15).? This resistor adds damping and reduces the Q of your crystal's equivalent circuit.? It might be insignificant in this case, but that might not always be true.? Also there are cases where adding a single resistor disturbs the balance of a balanced circuit - so it might (sometimes) be better to fix this problem yourself (instead of letting LTspice), by adding appropriate resistor(s), so that every circuit node has at least one DC path to ground.
?
If you want to fix the problem yourself, add a very big resistor from the node to ground, or to another voltage if there is one that is better than ground.
?
In your circuit, nodes Q1, N004, and N005 all lack a DC path to ground.? They have a DC path to each other.? They are isolated from ground by C1, C6, C7, and C8 on one end, and by C3 on the other end.
?
LTspice picks one of those three nets (not quite arbitrarily) and adds GFLOAT between that net and ground, which fixes the problem for all of them because they share a DC path to each other.
?
Note: The series RLC circuit or Figure 2(b) is an equivalent model of Figure 2(a) inside the IEEE paper.
Perhaps.? But neither is equivalent to the crystal model in Figure 1 in the paper.
?
I rarely ever see cases where a crystal needs to be modeled in SPICE as more than two resonant circuits (series and parallel), and one is usually sufficient.? I wonder if the model in Figure 1 was supposed to represent the first three harmonics?? If that is the case, one might be able to omit the other harmonics.? Crystal oscillators can be tricky and under the right circumstances they can oscillate on an unintended harmonic.? Good oscillator circuits are designed to suppress the other harmonics.
?
Andy
?
?


Re: OPA square wave generator, single supply OPA is not working

 

Oops - correcting a typo.? I wrote:
It does not oscillate because the voltage on the "voltage" net (across the capacitor) ...
but that should have said:
It does not oscillate because the voltage on the "vcharge" net (across the capacitor) ...
?
Andy
?


Re: OPA square wave generator, single supply OPA is not working

 
Edited

wai wai,
?
The schematic you attached to your message today has several mistakes.? I am just letting you know.? It was a very sloppy schematic and you should not have used it as an example.
?
Apparently the question was about the LT1006.? But your schematic also has three other op-amps, which are apparently unrelated to the question, and you forgot to connect any power to those op-amps.? Without power, they can not operate.? Leaving inoperable circuits on the same schematic can cause problems with the simulation.? It might even have caused the oscillator to not oscillate (although that was not the reason in this case).
?
You used multiple net names on the same nets.? That is unwise and should be avoided.? Nets (wires) can have only one net name.
?
The comment on your schematic asked:
LT1006 is single supply OPA
but single 5V has no square wave oputput
dual power supply vcc & vee must be, why ?
The answer to that question is because your circuit is wrong.? It does not oscillate because the voltage on the "voltage" "vcharge" net (across the capacitor) never drops below the voltage at the R7/R6 junction, when the op-amp drives Low.? That voltage must become lower in order for the op-amp's output to go High, which it can never do.? The circuit has a stable operating point when the amp's output is Low.
?
You must re-arrange the bias conditions of your circuit to make it oscillate with a single supply.? The LT1006 op-amp is operating correctly.
?
Andy
?
?


Re: OPA square wave generator, single supply OPA is not working

 

wai wai,
?
I have edited your message to remove the nonsense schematic that you attached to your message.? DON'T EVER DO THAT!
?
Go back and read (actually read!) the instructions about using this group.? Notice where it says:
Important:? Do not attach?or include or embed or drag-and-drop any files or pictures in your messages.? Instead,?upload?files to this group's "Temp" folder -
Now, if you want help, upload your schematic file to the group's Temp folder.? Then tell us that you uploaded a file there.
?
You almost did the right thing earlier today, by uploading a schematic (humidity_sensor.asc), but then you deleted it!? Why?
?
I also deleted your schematic text because it has an unrecognizable character which even LTspice can't use.? That might have been caused by attaching your schematic code to a message.? Instead, UPLOAD the file, which preserves the characters.
?
Andy
?
?
?


Re: Crystal oscillator oscillation startup

 

@Andy
?
I have done the three modifications as per your valuable advices.
?
May I ask how to resolve the issue for floating node N004 ?
?
Note: V004 is between Q1 and the R1 of the series RLC circuit.
Note: The series RLC circuit or Figure 2(b) is an equivalent model of Figure 2(a) inside the IEEE paper.
?
Please advise, thanks !!
?


Re: OPA square wave generator, single supply OPA is not working

 
Edited

Please don't post such long netlists. Few of us will try to help using a netlist. Upload your .ASC file AND all the other files required to run the simulation, but not .RAW? and .LOG files or pictures,? in a ZIP archive to Files => Temp.

Go to the web page: /g/LTspice/topics. Click on Files in the list on the left. Then click on Temp. Then click on New Upload in the blue box at top left. Click on Upload File in the drop-down menu. Then send a message to tell us that you did that.

On 2025-05-04 09:02, wai wai via groups.io wrote:
LT1006 was a single supply OPA. Trying and gathered no output when single supply was used. welcome any hints or experience would be share, thanks.

the code used,
?
?
[Mod note: Edited for brevity]
--
Best wishes John Woodgate RAYLEIGH Essex OOO-Own Opinions Only If something is true: * as far as we know - it's science *for certain - it's mathematics *unquestionably - it's religion

Virus-free.