How to find reversed pin orientation in schematic vs PCB

I have a project where there was an existing Eagle .brd file and a PDF image of the schematic. I’ve imported the .brd file into KiCAD successfully. I then manually created a schematic in KiCAD based on the PDF file. I’m ready to associate the PCB to the schematic to have it assign the nets and footprints, but what I’ve found is that the pin numbers on the PCB footprints are sometimes reversed from the pin numbers in my manually generated schematic.

KiCAD warned me about some of these (particular around power nets), but it doesn’t warn me about all of them before I “Update Schematic from PCB”. The update results in lots of DRC errors afterwards where resistors, etc are reversed. In fact some nets are renamed in the process such that the net name on both sides of a resistor (for example) are the same.

Is there a way to identify components that are reversed in this way? I’m open to scripting if that’s possible.

Hi, I suggest manually rotate swapped resistors (hotkey R two times), either on schematic, or pcb itself. But this:

net name on both sides of a resistor (for example) are the same

bit of your problem sounds strange. Are you sure there is no connection (bug in importer??) in pcb of these resistor pads in the first place? Use hotkey “~” in order to highlight connection in pcb before “update sch from pcb”.

Thanks for the reply. I’ve been doing the hotkey R two times trick on the ones I’ve identified, but it’s the identifying that’s been problematic so I was trying to look into scripting something to dump a list of them. UPDATE – just realized there’s no API into the schematic database so I’m guessing a comparison script isn’t possible in v6.

FYI upon import the PCB nets are correct – I’ve double checked this. It’s only after “updated sch from pcb” that I see the issue where the same net is on both sides of the resistor (I assume because the resistor needed to be swapped prior to running the update).

…hmm, not much help from me here… :grin: probably I would add additional “ctrl +z” action after verifynig failed “update sch from pcb” step, which is far away from your idea with scripting. I will watch this tread to see if something clever will be proposed :slightly_smiling_face:

(Also, you could enable pin number visibility in schematics, so you could at least visually check where resistor pin 1 and pin 2 are. Visibility can be turned on via symbol properties, but not to all resistors at once. In case this would be useful let me know)

I apologize for the one large image, but I’m a new forum user and am limited to 1 image per post.

Here’s a before and after of a particular resistor, R17. The only action between the top screenshot and the next 2 screenshots is “update sch from pcb”. The bottom image is when I rotated R17 BEFORE I ran “update sch for pcb”. In this case you can see the behavior is as expected.

Now I’m wondering if this is an “update sch from pcb” bug. I’m running 6.0.8-1 on macOS.

Do you rotate resistor in schematic or in pcb?

You should enable pin visibility on R17 for troubleshooting.

How did these net labels occurred in the schematics - manually? I dont think “update sch from pcb” can edit manually placed netlabels. All nets are created in pcb via importer, an then transfered to eeschema. No manually placed netlabels should exist in schematic before “upd sch from pcb”.

(I guess, I have not used eagle importer ever, only played with altium importer several times)

That should not be a problem now.

1 Like

Thanks for your attempts to help, @poco.

I only rotate I the sch and didn’t put in any manual net labels in the sch.

The net labels in the sch (in those last two images) are from the update. I did enable the net labels check box when updating.

I’ll turn on the pins — it’s a good idea. Is it possible to just turn them on for all symbols in one shot just to speed things up?

Again I was just looking for a way to identify components I’d manually placed in the sch that need to be swapped in order to be consistent with the PCB. Sounds like there’s no such thing.

The fastest way to show pin numbers would be to create a temporary copies of problematic components like resistors, caps and diodes, with pin visibility property turned on (save them to your library). Then go to tools - change symbols (or similar), and point existing instances to your newly created symbols. After you finished tying sch to pcb - replase those symbols again with ordinary ones. Maybe there is another way under preferences, but I am not near PC.

Another way would be to search and replace sch file contents with text editor (maybe).

I did a bit of a cop-out/work around for this a couple of weeks ago.

What I did was change the colour of the ratlines to, in my case, bright lime green.
The idea was, after updating the PCB from the schematic, all the ratlines for the reversed footprints are easily seen… a bright green stripe through the middle!
I then just toggled between schema. and PCB, reversing the symbols and occasionally updating, until no bright green lines were left on the PCB.

Note: to do this you need to go into Preferences / Preferences / PCB editor / Colours, to change your colour theme from the default.
Ratlines are in the RH Appearance table in the Objects.

1 Like

Thanks, that colored ratsnest suggestion was a good tip.

Between yours and @poco 's advice I figured out all of the swapped parts and things are looking good now. Thanks to you both!

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.