I'm trying to make a latch (in ltspice), so if the comparator output (A) goes low, the latch will trigger and C will go high. C should stay high, irrespective of whether A goes high or low after that. I'm getting strange values on ltspice. Must be missing something basic... I've tried with different op amps too (lm324, lm358, tl072), same results. Also, with and without the resistor between A and B. Also with single ended supply. Also, changed around the resistor values. No difference. Should try it on breadboard maybe?
Voltages at A, B and C A B C 5 4.4 0.6 A and B disconnected 0.5 20m 5 1K between A and B 20m 20m 5 A and B shorted 5 15m 5 1000 meg resistor between A and B 5 4.4 0.6 10000 meg resistor between A and B (~60 pA flowing A to B)
What's going on?
edit: circuitlab seems to be giving correct results. maybe an ltspice thing?
Update: I tried this on the breadboard, and the circuit did not work properly, just like LTSpice predicted. So although it should work in theory, just like circuitlab simulates it, it did not work in practice, just like LTSpice predicted.
I had to play with the resistor values, and it sort of seemed to work only if I added a 1K to the base of the NPN. Also, I had to set all resistor values to 1K. Also, this was with the BC547/BC557 as that was all I had with legs. However, the circuit was finicky, and the output went high without reason, if I barely touched the PNP base sometimes. Probing with the multimeter would turn it on many a times. It was just not stable.
Of course it only sort of worked with the LM393. The LM358 can not turn it off, guess why? (The LM358 output is not high enough to turn off the PNP, so the circuitlab simulation is horribly wrong.)
My guess is that LTSpice simulates some sort of noise in the picoamperes to approximate the real thing. Breadboard would just make it worse. I tried this with a single ended supply.