Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
- LTspice
- Messages
Search
Using Op Amp as comparator
When I use the Universal Op Amp or Universal Op Amp 1 as a comparator, the output chart changes from V to MV.? Here are the parameters:
?
Positive supply 12 V
Negative supply -12 V or GND
Reference voltage 3 VDC
Input Voltage 6 V 1000 Hz sine
?
For the life of me, I can't get the comparator to work.? When I try the MAX9095 comparator, the display is not in MV, but the comparator output is a straight DC line.
?
Why does LTspice change the chart to MV using the Universal Op Amps? With the MAX9095, why doesn't the output change at the transitions when the sine wave crosses the fixed voltage??? THANKS. |
Re: Vin vs. Load - YX logarithmic plot
On Fri, May 2, 2025 at 10:30 AM, <rick_church@...> wrote:
I want to add this note:? Usually when I change the Y-axis from linear to log, LTspice scales the Y-axis so that it?covers too much range (too many decades), making it a less useful plot.? If I immediately right-click in the plot pane and select "Autorange Y-axis", it usually fixes that problem.
?
If the Y-axis waveform includes negative values, then it might still be scaled with too much range to be helpful.? In that case, right-click on the Y-axis and set a new value for the Bottom, so that the displayed plot does not cover so wide a range.
?
Andy
? |
Re: Crystal oscillator oscillation startup
Re: the upside-down N-channel MOSFETs -
?
It should also be noted that many MOSFETs are symmetrical, where Source and Drain are electrically interchangeable.
?
Even when that is true, I think it would be wise to draw the schematic correctly, so that the symbol's Source pin is actually used as a Source pin, and not used as a Drain pin.? The way you drew it, you used the Source as the Drain, and you used the Drain as the Source.? It might not alter its performance but the schematic is incorrect in that regard.
?
I do not think there is any reason why those FETs needed to be drawn upside-down.
?
Andy
?
? |
Re: Crystal oscillator oscillation startup
On Fri, May 2, 2025 at 01:22 PM, Cheng Fei Phung wrote:
I think you are missing the crystal.? Where is the crystal? ?
Is this really a crystal oscillator?? Or is it a relaxation oscillator without a crystal?
?
What determines the oscillator's frequency?
?
Andy
? |
Re: Crystal oscillator oscillation startup
On Fri, May 2, 2025 at 12:59 PM, Cheng Fei Phung wrote:
I think that is unlikely.? It is a schematic drawing issue, not a model one.? MOSFETs are normally used where the N-channel current flow is into the Drain pin, through the channel, and out the Source pin.? But your N-channel MOSFETs are drawn upside-down, forcing positive channel current to flow backwards, from Source to Drain.? I do not think that their SPICE model definition can alter that; the physical arrangement of the transistor's internals would be all wrong.? All SPICE FET models using .MODEL statements are meant to use the pin-order D-G-S-B.? You have hooked your circuit to the wrong pins.
?
Two other things to note:
?
You might have used the models not the way they were intended.? The model file (mosfet_018.lib) defines both .MODEL models and .SUBCKT models, where the only difference is that the .SUBCKTs come with built-in formulas for AS, AD, PS, and PD.? But your schematic uses the .MODEL models, which means they do not pass values for AS, AD, PS, or PD to those transistors from their .SUBCKT definitions.? That's OK, if that is what you intended.? Just be aware that all of your MOSFETs default to AS=0, AD=0, PS=0, and PD=0 because your transistor symbols did not specify values for those parameters.
?
Also, I see that some of your transistors might connect their Bulk pins to the wrong? place.? Looking at M19, M17, M9, M37, M39, M5, M22, M33, and M35, their Bulk pins connect to internal circuit nodes between the supply voltages.? That is probably not how those transistors are built (on the die), so those connections are probably incorrect.? Normally, MOSFET Bulk pins should connect to either VSS (for N-channel) or VDD (for P-channel) and to nothing else - with very few exceptions.? I am not a fabrication expert but I would expect that additional wafer processing steps are required to connect those pins to any other net.
?
Andy
? |
Re: Crystal oscillator oscillation startup
@Tony
?
The upside-down issue is due to how mosfet_018.lib had been defined, please note that both PM and NM from this lib file had been verified previously.
See also /g/LTspice/photo/302220/3911530 |
Re: Vin vs. Load - YX logarithmic plot
You can change to a logarithmic axis (in LTspice) even if the waveform has negative values.? It just won't plot over those ranges.? Best to add a limiting function first (in the waveform window).
?
LTspice is a wonderful learning experience.? There tends to be more than you knew, just waiting for you to try.
?
Andy |
Re: Possible g;itch in stepping parameters
Don't worry, it doesn't matter. An expression like
?
?VTHRESH & V(B)
?
is evaluated as if it had been written as
?
(aa + bb) & V(B)
?
Best Regards,
Mathias ?
On Fri, May 2, 2025 at 05:34 PM, <mhx@...> wrote:
On Fri, May 2, 2025 at 01:22 AM, Andy I wrote: |
Re: Possible g;itch in stepping parameters
On Fri, May 2, 2025 at 01:22 AM, Andy I wrote:
E_ABMGATE ? ?YINT 0 VALUE { { IF(V(A) > { VTHRESH } ?& V(B) > { VTHRESH },{ VDD },{ VSS } ) } }The above illustrates why '{{' instead of '{' could matter, e.g. when the source file also defines " .param VTRESH = aa + bb ". In that case it matters (because of precedence rules) whether VTRESH is evaluated before its value is substituted, or if the (debracketed) *text* of VTRESH is substituted in the VALUE above before VALUE is evaluated as an expression. I would hate to debug that type of errors or mistakes. I think it also matters how { (VTRESH) } is handled. -marcel |
Re: Vin vs. Load - YX logarithmic plot
The plot window will give you the chance to scale the axes logarithmically.? Be careful that your results don't include negative or zero values, which will prevent you from selecting log scaling.? At least it works that way in Excel.? In the plot window, hover the mouse over the axis of interest, <RMB> opens the Axis limit window, check the Logarithmic box at the bottom.??
I apologize if this is obvious to you.? I get frustrated with some answers that assume I know the intricacies of a program I'm still trying to learn. ? |
Re: Crystal oscillator oscillation startup
On Fri, May 2, 2025 at 09:20 AM, Cheng Fei Phung wrote:
Umm, your simulation is a .DC sweep.? .DC sweeps can't oscillate.
?
Where is the crystal?? Nothing stands out as being the crystal.? If it is there, I apologize.? Please help us by pointing it out.
?
Did you upload the wrong schematic by accident?
?
When you get to the point of running .TRAN simulations, try it first with .TRAN ... STARTUP and a very long simulation time (10 or 1000 seconds instead of 10 microseconds).? If that doesn't work, then try .TRAN ... UIC.? If it still won't oscillate, try adding specific sources of transients (PULSE sources) into the circuit, to kick-start it.? But first I think you need to add a crystal, and make sure that it has good parameters for a high-Q crystal.
?
Andy
? |
Re: Crystal oscillator oscillation startup
¿ªÔÆÌåÓýThere are variety of problems that need fixing first, most importantly: all your N channel? devices are upside-down. I don't actually see a crystal in your schematic, but that's secondary.My advice is to start small. Make an inverter. Test it - does it work? Have you tested any part of this schematic? If this is your first attempt, you stand zero chance of drawing it all out and having it to work first time. --
Regards, Tony On 02/05/2025 15:20, Cheng Fei Phung
via groups.io wrote:
|
Crystal oscillator oscillation startup
Here is an initial circuit draft of a crystal oscillator :?ck_osc.zip ? ? ? ? ??
?
I have so far checked the circuit operating points according to the circuit requirements.
However, it just does not start to oscillate.
?
I am a circuit beginner noob, please feel free to point out mistakes and guide me to solve the oscillation startup issue. |
Re: Possible g;itch in stepping parameters
In versions prior to 24.1, parameter substitutions almost worked like C-macros. This elicited creative use cases like dynamic nodes, stepping models etc. It also caused hard to fix bugs, in particular in sub-circuits.
24.1.x works very differently. It's a complete rewrite of the entire netlist processing; the reason will become obvious in the near future. Unfortunately, this meant that said creative use cases no longer worked in the initial version. Since then, adjustements have been made as needed to stay backward compatible.
?
Anyway, as a result it matters not whether you write x, (x),?{x}, or 'x' in an expression. (The latter is hspice syntax.)
?
As to the worry part: We are aware, after seeing how the release of 24.1 did not quite go as intended :-(
?
Best Regards,
Mathias ?
?
On Fri, May 2, 2025 at 02:22 PM, Andy I wrote:
|
Re: Possible g;itch in stepping parameters
On Fri, May 2, 2025 at 06:38 AM, Mathias Born wrote:
Although I am happy to hear that, I would be real careful about making changes like that.? On face value, this seems like it is a great thing.? But things are rarely as simple as they seem. ?
Are you suggesting that expressions like this one:
are now admissible in LTspice 24.1.7 and moving forward, and no longer produce warnings or errors?? Until now, that was not "perfectly fine" when written that way and the reason may have been semi-obvious.? Have you forever changed the rules for curly braces?? Have you considered every possible consequence of that change, both good and bad?
?
On the one hand, I would like to see fewer instances (preferably none) where LTspice objects to bad syntax like that one.? On the other hand, every change has consequences.
?
Don't misunderstand me.? I would be delighted to be rid of the above syntax difficulty, at long last - especially as it seemed that LTspice both objected and accepted it.? But I worry about the consequences.
?
Andy
?
? |
Re: Possible g;itch in stepping parameters
Yes, it is.
However, curly braces are perfectly fine in any expression and putting them in a .meas is therefore not incorrect. At least not anymore.
?
On Thu, May 1, 2025 at 10:44 PM, Bell, Dave wrote:
|
to navigate to use esc to dismiss