Sunday, April 22, 2012

Advanced Eagle Layout Tutorial - Building Better Library Parts - Pin Swaplevel

Once you have pin direction down, we can move on to some of the other features of Eagle's pins.

How to Use Pinswap/Swaplevel

Swaplevel can come in handy on occasion. Its purpose is to allow you to be able to dynamically change which pin is assigned to a certain pad when using an instance of a part in your schematic/on your board. The end effect would be the same as physically swapping the pins' locations in the symbol while leaving the rest of the symbol intact. Let's look at an example using a simple resistor:

Now, because a resistor is the same forwards, backwards, and and any which way, it makes sense to be able to arbitrarily swap the pins. Look at the following board.

Oops, my nice row of resistors has one that is flipped! I could rotate the part 180 degrees, but then the text name would in the wrong place. I can simply select the 'Pinswap' tool, click on the first SMD pad and then the second. Voila! The pins have been swapped!

Be warned, though, that something else happened in the schematic.

Do you see it? The pins were swapped on R3. R3 now needs to be rotated in the schematic.

Pin Swaplevel in Symbol

The swaplevel of a pin changes

  1. Whether or not it can be swapped
  2. With what pins you are allowed to swap it with
All pins with the same swaplevel can be swapped using the 'Pinswap' tool. Pins with swaplevel '0' cannot be swapped at all. So, for a resistor, both pins could be set at swaplevel '1', signifying they can be swapped, and swapped with eachother.

When to Use Swaplevel

Swaplevel only makes sense on mostly passive devices such as capacitors, resistors, and inductors. Perhaps it might come in handy on the coil of a relay. Swaplevel could also be used, however, on generic connectors. Say you have a 3 pin serial connector with Gnd, Rx, and Tx. If you decide that Rx and Tx are reversed, you could simply swap the pins. Swaplevel does not make sense on semiconductors, or numerous other components. For example, the pins of a diode may not be swapped, because they are functionally different.

In all honesty, thought, I have only ever used 'Pinswap' a handful of times. The functionality can be duplicated by just deleting nets and rerouting. However, in the few times I've needed to use 'Pinswap', it was nice to have a device with appropriate swaplevels in the library.

1 comment :

  1. For more specific and up-to-date information about BetWinner and Satbet, I recommend visiting their official websites or contacting their customer support teams. They will be able to provide you with accurate and detailed information about their platforms and offerings.Betwinner | Satbet