0
\$\begingroup\$

I am trying to generate a subcircuit on ltspice. It is a first order filter where I would like to adjust the cuttoff frequency. I know that it is possible to do it on component but on a parameter ("param") I do not know how to do it.

enter image description here

I would like to set directly the param "fp" of the subcircuit. Does anyone know a way to do it ?

Have a nice day !

\$\endgroup\$
6
  • 1
    \$\begingroup\$ I'm confused. What you have there works exactly as you need: all you have to do is to use fp as the parameter to be passed to the subcircuit, and Rfiltre will be automatically calculated. It looks like you had no problem to start with, after all. :-) \$\endgroup\$ Jan 20 at 12:43
  • \$\begingroup\$ Actually, my subject was not clear I wanted to do a netlist for a SUBCIRCUIT and I wanted to pass a parameter to this SUBCIRCUIT when I put it on my scheme. I found the solution :) \$\endgroup\$
    – Jess
    Jan 22 at 7:25
  • 1
    \$\begingroup\$ Yes, that's what I was talking about. Make the subcircuit out of what you have in the picture, then use fp=<...> as the parameter. Here are a thousand words. The green numbers indicate the order of the pins for the symbol I chose. \$\endgroup\$ Jan 22 at 9:23
  • \$\begingroup\$ You re right ! Actually I did not write the parameter line on the same line of the SUBCKT. That was my error ! \$\endgroup\$
    – Jess
    Jan 22 at 9:29
  • \$\begingroup\$ You can write them in two ways: on the same line with the .subckt, written as params: (note, no dot), or normally, as you have them. I forgot to add a fp=100k to the symbol, but I'm sure you already figured that out. ;-) \$\endgroup\$ Jan 22 at 9:40
1
\$\begingroup\$

Try this (it works in microcap): -

enter image description here

I didn't use the "=" (equate) to make these statements work but, they still work when you do use the equate (optional I guess). LTSpice might need the equate.

I think your main problem was expecting the raw "10n" to be recognized in the .param Rfiltre statement. Having said that, microcap will allow it. I can also keep the curly braces around Rfiltre in microcap too.

\$\endgroup\$
1
  • \$\begingroup\$ Thank youuuuuu !!!! \$\endgroup\$
    – Jess
    Jan 20 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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