1

I am trying to make simpler more general questions that might have more generally useful answers.

If you build a mixed analog digital circuit then you need to have models of real TTL or CMOS gates which have realistic current characteristics, sensing thresholds, etc.

I have an example with just two inverters:

enter image description here

and that second inverter doesn't reach 5 V output when the "load" R7 is 1 kOhm. But in real life I know that if I use a 1k resistor to ground I get fine near 5V potential on the output. So I know that somehow these parameters don't work right in LTspice.

Are there best practices how to set them?

Are there libraries of LTspice devices for common TTL and CMOS (74LS, 74HC...) devices to use in LTspice?

I know LTspice is for analog simulation, and that's the point.

If the answer is to draw up the schematics of the gates with transistors etc, as they are shown in the data-sheets, then that's a heck of a lot of work. Didn't somebody do these already? Google didn't show much.

Gunther Schadow
  • 1,441
  • 7
  • 22
  • There was an LTspice group, with lots and lots of custom files, on Yahoo. That's been moved somewhere. But the files are still there. You should dig around and see if you can find their large library of files. I think they have at least a set for HC types. But they may have TTL or LS TTL there. I never bothered with them, though. You can also just cobble up a .SUBCKT for combinatorial stuff like the NAND, AND, OR, NOR, XOR. Took me just a few minutes to make a NAND, for example. Go [here](https://electronics.stackexchange.com/a/372297/38098) to see how you can make your own symbols. – jonk Aug 25 '20 at 01:48
  • For example, you can just steal the diffschmtbuf from the Digital subsection of LTspice's symbols, edit the darned thing to arrange for an A and B input, a Y output, and access to ground and Vcc. (That's 5 pins total.) Save it. Create a model file with a .SUBCKT and link the two. You can make it generic by creating a model file with lots and lots of .SUBCKT models in it (one for AND, one for NAND, etc.) and then LTspice will drop down a nice menu of choices to use and then it will just work right when you use it. – jonk Aug 25 '20 at 01:55
  • 1
    Examine [this](https://i.stack.imgur.com/upvhC.png) snapshot from an LTspice page. There, you can see the full schematic of a NAND, plus a .SUBCKT of the same NAND, plus a cobbled-up NAND symbol (that looks nothing like the logic symbol for it, but who cares?) that uses the .SUBCKT, plus two cases that demonstrate the output of the NAND, correctly. – jonk Aug 25 '20 at 02:04
  • @jonk For [LS04](https://www.ti.com/lit/ds/symlink/sn74ls04.pdf) (p.6), the datasheet indicates a minimum `VOH=2.7` for `IOH=-0.4m`, `VIL=0.8`, and `VCC=4.75`. That implies the minimum load must be `2.7/0.4m=6.75k`, yet they specify transition times to be measured with `RL=2k`? So I tried simulating the discrete version (similar to your link, shown in the datasheet, Q=2N5089), with the same values as above for `VIL` and `VCC`, with a load of `1k`, and the output showed `3.07 V`, so `IOH=~3.07m`. What am I missing? – a concerned citizen Aug 25 '20 at 08:32
  • @aconcernedcitizen I didn't test that schematic. (I'd need to research TI's test jigs and then implement them to do that.) I just copied it from the TTL databook for the 7400 NAND, as shown in its datasheet. Nothing special added to it. I didn't have models for their internal BJTs, so I just pasted in the venerable 2N2222 which has existed for a long, long time. Hopefully, it's not too far from the saturation current or beta. But who knows? Also, I used the 1N914=1N4148 diode. The 1N914 has also been around forever. Again, not sure how well it matches the IC version. – jonk Aug 25 '20 at 19:40
  • @jonk Oh well, the datasheet seemed unclear, sorry for the noise. :-) – a concerned citizen Aug 25 '20 at 19:57

0 Answers0