Report it! It's a serious issue, and not easy to properly fix, either. Obviously, spice netlists have the opposite pinout for diodes from those in the KiCAD libraries in general. That's a big problem.
The problem is that Kicad is first and foremost a PCB layout tool. That ngspice or the particular diode model in question doesn't match the IPC recommendations is a problem, and there's no real good solution, other than to always verify your library parts.Yep, clearly KiCAD is correct here. And changing spice is impossible (it would invalidate a gazillion subcircuit models out there). So I guess the only thing to do is swap the pins when generating spice netlists... |O
Kicad (v4 at least) has a silly terminology problem where a pin name is referred to as a 'pin number' in the software. To make it worse it has another field called 'pin name' which is actually a just a text description, unused in netlist creation. This makes users think they have to assign an arbitrary number to every pin which in not the case.
Kicad (v4 at least) has a silly terminology problem where a pin name is referred to as a 'pin number' in the software. To make it worse it has another field called 'pin name' which is actually a just a text description, unused in netlist creation. This makes users think they have to assign an arbitrary number to every pin which in not the case.
The pin number is a standard thing, across every PCB CAD package and in common use. It doesn't even have to be a number. As you say, it can be A and K for a diode's anode and cathode, and for BGA and PGA packages it'll be something like A1. it is what maps a pin on your schematic symbol to the pin on the physical footprint.
None of this makes users think they need to assign an arbitrary pin number to every pin! If you want your circuit to actually work, every pin on a symbol must have a pin number (which again doesn't have to be a number) that exactly matches a pin on the footprint. This is the opposite of arbitrary.
I used the standard diode symbol in my schematic (just search for diode) and set the value field to the actual part number. I then assigned a footprint from the Diode_SMD library. At that point I thought I was done, but now that I started layouting, all these diodes have pin one and two reversed...
I now have two questions:
- What did I do wrong
- How do I fix this the easiest way?
If you are using some generic symbol it is folly to assume that stuff like pin numbering is correct.
For me the only right solution is to to make a custom library from all the parts I use.
The problem is that Kicad is first and foremost a PCB layout tool. That ngspice or the particular diode model in question doesn't match the IPC recommendations is a problem, and there's no real good solution, other than to always verify your library parts.
Anyway, it turns out that the KiCad to Spice interface now has a provision to re-order the pin numbers, so it's a solvable problem, if annoying.It has had this since day one, but the main difference with v5 is that there is no longer a special simulation symbol library; spice properties like pin mapping (node sequence) is part of the regular symbol properties. At some point I suspect the idea is also for parts like op amps to have a simulation model as part of the symbol properties. (It's there but not generally populated yet.) To get a view of the idea, in the
Fun with polarity marks: https://blog.screamingcircuits.com/2013/01/how-not-to-mark-a-diode.html
We have similar problems where a reel gets ordered with second-source parts from a different manufacturer, and they decided to load the reel differently. Every diode fails at test. Sometimes the same manufacturer decides to load the tape differently.
I think the prudent engineer learns not that there is only one way to do things (whether house rules or international standard), but to be always on guard for this sort of problem.
By the way, thinking about my comment above a little further, one could make the argument that SPICE and the JEDEC standards didn't actually NUMBER diodes and transistors. Take SPICE, the anode and cathode don't actually have the concept of a pin-1 and pin-2, rather, it's just the order of parameters to the DIODE model where anode comes first. Similarly, JEDEC didn't say anything about pin-1 for diodes or transistors - it just gives them letter names, not numbers. In the vein, you could say that IPC didn't buck the trend, rather they just assigned numbers to the pins that had never had numbers assigned in the first place.
There still is a small PSPICE library, where I grabbed a generic op-amp for my last project.
.subckt IDEAL 1 2 3 4 5
E1 5 0 1 2 1000000.0
.ends
If you are using some generic symbol it is folly to assume that stuff like pin numbering is correct.The REAL problem here is having diodes with pins 1 and 2! No diode has a pin 1, it has an anode and cathode.
For me the only right solution is to to make a custom library from all the parts I use.
If you are using some generic symbol it is folly to assume that stuff like pin numbering is correct.The REAL problem here is having diodes with pins 1 and 2! No diode has a pin 1, it has an anode and cathode.
For me the only right solution is to to make a custom library from all the parts I use.
So, I redo all my libraries to have pins A and K, both in the schematic and footprint. Then, there is no confusion.
You just have to remember to ONLY use your own part library.
Jon
So, I redo all my libraries to have pins A and K, both in the schematic and footprint. Then, there is no confusion.
QuoteSo, I redo all my libraries to have pins A and K, both in the schematic and footprint. Then, there is no confusion.
Not really, Cathode is spelled with C therefore your libraries shall maintain A & C as default.
The REAL problem here is having diodes with pins 1 and 2! No diode has a pin 1, it has an anode and cathode.
So, I redo all my libraries to have pins A and K, both in the schematic and footprint. Then, there is no confusion.
You just have to remember to ONLY use your own part library.
The REAL problem here is having diodes with pins 1 and 2! No diode has a pin 1, it has an anode and cathode. So, I redo all my libraries to have pins A and K, both in the schematic and footprint. Then, there is no confusion. You just have to remember to ONLY use your own part library.
That works until you have dual diodes in SOT23 packages, then you have to use pin numbers again.
The only thing worse than not following an industry standard is to create you own.
QuoteSo, I redo all my libraries to have pins A and K, both in the schematic and footprint. Then, there is no confusion.
Not really, Cathode is spelled with C therefore your libraries shall maintain A & C as default.
The traditional label for cathode pins is K, not C. Reference: https://electronics.stackexchange.com/questions/65981/why-is-the-symbol-for-cathode-a-k