Gateswap and Pinswap tool

From DP

Jump to: navigation , search



We route all our PCBs manually instead of using an autorouter. This can be a tedious job sometimes, but we think it gives the best results.

Sometimes we're just about to finish a PCB, when we notice a MUCH better way to route it if only a few connections could be changed. The Gateswap and Pinswap tools can help. They can quickly change connections between interchangeable pins or peripherals in an IC. These tools add flexibility to a designer dealing with complex and cramped routing.

Pin and Gates

Array of parts

Eagle-wiki-swapping 4nand.png

4 gates inside an 74xx00

Gate swapping is available only no chips that have interchangeable devices in a single package. A good example of these is the 74xx00 logic IC which has four 2 input NAND gates, the 74xx573 with eight latches, and even LM324 dual op-amps. These chips have multiple identical devices, so you can swap them without affecting your circuit.

Pin properties

A good example for this is the 74xx10 which contains 3 input NAND gates. Each input pin of the NAND gate is interchangeable among the others.

Another example is the 74xx4066 bilateral switch used on the Bus Pirate. Input and output can be swapped since they only act as an analog switch. Swapping their pin connection is OK without having to worry about the impact on the circuit.

How to


We have a resistor array RN1 as an example below, that's four resistors in a single pack. Using arrays is usually cheaper because there are fewer parts to place and inspect. Resistor arrays are a good example for both pinswaping and gateswaping because resistors are bidirectional, and all the resistors inside the package are identical to all the others.

Eagle-wiki-swapping unroute.png

Here is an example where two unrouted wires cross paths.

Eagle-wiki-swapping route-a.png

We have two solutions. One is to route one trace directly, and then use vias to route the other one below.

Eagle-wiki-swapping gateswap-ab.png Eagle-wiki-swapping route-b.png

Instead, we can use the gateswap tool and swap RN1’s resistors C and B by clicking gateswap and selecting RN1C and RN1B. This will swap these two resistors and let us route both of them nicely.


Eagle-wiki-swapping pinswap-1.png Eagle-wiki-swapping pinswap-2.png

Here is an example of the same resistor array RN1 where two sides of the resistor are swapped. By clicking the pinswap tool and selecting pin 2(below) and pin 7(above) the two pins will be swapped.


Using Gateswap and Pinswap is great when you've stumbled upon nearly impossible routing paths on your board. Having a good library is also important for implementing this because some libraries have parts that don't support Gateswap. You can grab our open source, public domain Eagle (and KiCad!) libraries here..