I am planning to simulate a circuit that uses the LM339. Would this be the correct way to simulate essentially the four comparators? I essentially made 4 instances with their own power supply, so the pin assignments do not override each other.
The normal method is to use the units: U1A, U1B, U1C, U1D and U1E, so all opamps are from the same IC package. This does require that your spice model is aware of the pin mapping of those comparators.
I’m certain it can be done, and it’s also relatively easy. Basically you have one model of the comparator, and then you create multiple instances that use that same model to create different pinouts. I do not use this much myself, and forgot the exact syntax. In the examples linked below, the Triangle generator with MAX9000 uses a dual opamp. You can probably copy the syntax from that, but I have not verified this.
Don’t do this. You’ll run into endless problems both with schematic and PCB layout, and even more with simulation.
Just use one LM339 and place all five units on the schematic (A…E).
So I thought I could get away with using 4 different instances of different LM339 since the pins won’t overwrite other (as you and ML9104 pointed out, I’m just creating more problems for myself). Do I need to edit the Spice Model to include all the pins?
Put this at the end of the LM339 file! It is pretty self explanatory. The order is for KiCad if they have not changed something inside. In my exp you have to place all units in the schematic even if you do not use them otherwise it can do weird errors.
When you selected “LM339_QUAD” in the simulation model click ok then open it again to see pins are in the correct order.