Skip to main content
Built-in Elements

<differentialpair />

Why use a differential pair?

A differential signal, such as USB D+ and D-, travels over a positive and a negative trace. If one route is longer than the other, the two halves of the signal arrive at different times.

<differentialpair /> tells a supported autorouter which two existing traces form the pair and how much their routed lengths may differ. It does not create electrical connections; add those with <trace />.

This element currently constrains length matching only. It does not configure differential impedance, trace width, pair spacing, or parallel routing.

Quick start with trace names

Use trace names when the same circuit creates the traces and the constraint. Give each <trace /> a unique name, then reference those names from <differentialpair />.

export default () => (
<board width="24mm" height="12mm">
<chip
name="U_HOST"
footprint="soic8"
pinLabels={{ pin1: "USB_DP", pin2: "USB_DM" }}
pcbX={-7}
pcbY={-2}
/>
<chip
name="U_DEVICE"
footprint="soic8"
pinLabels={{ pin1: "USB_DP", pin2: "USB_DM" }}
pcbX={7}
pcbY={2}
/>

<trace
name="usb_dp"
from=".U_HOST > .USB_DP"
to=".U_DEVICE > .USB_DP"
/>
<trace
name="usb_dm"
from=".U_HOST > .USB_DM"
to=".U_DEVICE > .USB_DM"
/>

<differentialpair
name="USB_DATA"
positiveConnection="usb_dp"
negativeConnection="usb_dm"
maxLengthSkew={0.05}
/>
</board>
)
PCB Circuit Preview

In this example:

  • usb_dp and usb_dm create the electrical connections.
  • <differentialpair /> groups those connections for length matching.
  • maxLengthSkew={0.05} allows an absolute routed-length difference of up to 0.05 mm.

Supported autorouters try to add length, often as a meander, to the shorter route. Routing can fail when there is no valid segment or enough room to meet the tolerance.

Choosing trace names or pin selectors

UseWhen to choose itExample
Trace nameThe same circuit defines and names the traces.positiveConnection="usb_dp"
Pin selectorA reusable component knows its differential pins, while its parent creates the traces.positiveConnection=".USBC > .DP1"

You may use a trace name for one connection and a pin selector for the other. Each value must ultimately resolve to exactly one trace in the same board or autorouted subcircuit.

Properties

PropertyTypeDescription
namestringOptional name for the differential pair.
positiveConnectionstringExact positive trace name or pin/port selector.
negativeConnectionstringExact negative trace name or pin/port selector.
maxLengthSkewnumberMaximum absolute difference between the routed lengths, in millimeters. Accepts 0 through 1; defaults to 0.1 mm.