<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
Give each <trace /> a unique name, then reference those names from
<differentialpair />.
export default () => (
<board width="32mm" height="20mm">
<connector
name="J1"
manufacturerPartNumber="TYPE-C-31-M-12"
footprint="jlcpcb:C165948"
pinLabels={{ pin8: "USB_DP", pin9: "USB_DM" }}
pcbX={-10}
pcbRotation={-90}
/>
<testpoint name="TP_DP" pcbX={12} pcbY={3} padDiameter="1.2mm" />
<testpoint name="TP_DM" pcbX={2} pcbY={-3} padDiameter="1.2mm" />
<trace name="USB_DP" from=".J1 > .USB_DP" to=".TP_DP > .pin1" />
<trace name="USB_DM" from=".J1 > .USB_DM" to=".TP_DM > .pin1" />
<differentialpair
name="USB_DATA"
positiveConnection="USB_DP"
negativeConnection="USB_DM"
maxLengthSkew={0.05}
/>
</board>
)
In this example:
USB_DPandUSB_DMcreate the electrical connections.<differentialpair />groups those connections for length matching.- The large center meander makes the route-length correction visible.
maxLengthSkew={0.05}allows an absolute routed-length difference of up to 0.05 mm.
The connector uses the real TYPE-C-31-M-12 footprint, but only one D+/D-
contact pair is labeled and connected here. The testpoints stand in for
downstream USB-device pins, so this is not a complete USB circuit.
Quick start with pin selectors
Use pin selectors when you want the pair declaration to identify each trace by a pin it connects to. Each selector must resolve to one pin that belongs to exactly one trace.
export default () => (
<board width="32mm" height="20mm">
<connector
name="J1"
manufacturerPartNumber="TYPE-C-31-M-12"
footprint="jlcpcb:C165948"
pinLabels={{ pin8: "USB_DP", pin9: "USB_DM" }}
pcbX={-10}
pcbRotation={-90}
/>
<testpoint name="TP_DP" pcbX={12} pcbY={3} padDiameter="1.2mm" />
<testpoint name="TP_DM" pcbX={2} pcbY={-3} padDiameter="1.2mm" />
<trace name="USB_DP" from=".J1 > .USB_DP" to=".TP_DP > .pin1" />
<trace name="USB_DM" from=".J1 > .USB_DM" to=".TP_DM > .pin1" />
<differentialpair
name="USB_DATA"
positiveConnection=".J1 > .USB_DP"
negativeConnection=".J1 > .USB_DM"
maxLengthSkew={0.05}
/>
</board>
)
Only one pin from each trace is needed. Here, .J1 > .USB_DP and
.J1 > .USB_DM select named pins and resolve to the two existing traces. A
component selector such as .J1 is not enough; select a specific pin.
Choosing trace names or pin selectors
| Use | When to choose it | Example |
|---|---|---|
| Trace name | The trace has a unique name. | positiveConnection="USB_DP" |
| Pin selector | The selected pin connects to exactly one trace. | positiveConnection=".J1 > .USB_DP" |
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.
If a selected pin connects to multiple <trace /> elements, use a trace name
to avoid an ambiguous match. In
phased autorouting, the routingPhaseIndex prop
assigns a <trace /> to a phase. Both traces in a pair must use the same value.
Properties
| Property | Type | Description |
|---|---|---|
name | string | Optional name for the differential pair. |
positiveConnection | string | Exact positive trace name or port selector. |
negativeConnection | string | Exact negative trace name or port selector. |
maxLengthSkew | number | Maximum absolute difference between the routed lengths, in millimeters. Accepts any non-negative distance and defaults to 0.1 mm. |