diff --git a/docs/elements/differential-pair.mdx b/docs/elements/differential-pair.mdx new file mode 100644 index 0000000..95d0fdd --- /dev/null +++ b/docs/elements/differential-pair.mdx @@ -0,0 +1,95 @@ +--- +title: +description: Match the routed lengths of two traces within a maximum absolute difference. +--- + +import CircuitPreview from "@site/src/components/CircuitPreview" + +## 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. + +`` 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.mdx). + +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 `` a unique `name`, then reference those names from +``. + + ( + + + + + + + + + + ) +`} /> + +In this example: + +- `usb_dp` and `usb_dm` create the electrical connections. +- `` 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 + +| Use | When to choose it | Example | +| --- | --- | --- | +| Trace name | The same circuit defines and names the traces. | `positiveConnection="usb_dp"` | +| Pin selector | A 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 + +| Property | Type | Description | +| --- | --- | --- | +| `name` | `string` | Optional name for the differential pair. | +| `positiveConnection` | `string` | Exact positive trace name or pin/port selector. | +| `negativeConnection` | `string` | Exact negative trace name or pin/port selector. | +| `maxLengthSkew` | `number` | Maximum absolute difference between the routed lengths, in millimeters. Accepts `0` through `1`; defaults to `0.1` mm. | diff --git a/docs/elements/trace.mdx b/docs/elements/trace.mdx index 985b0a8..4ab9ab2 100644 --- a/docs/elements/trace.mdx +++ b/docs/elements/trace.mdx @@ -131,32 +131,40 @@ export default () => ( ## Differential Pairs -For high-speed signals, you often need pairs of traces to have matched lengths. You can use the `differentialPairKey` property to group traces: - -:::info -The `differentialPairKey` property is in beta and not available on all autorouters yet! -::: +For high-speed signals, use a [``](./differential-pair.mdx) +to identify two traces and constrain their routed-length skew. Connections can +refer to the traces by `name` or by a specific pin selector. ( + ) `} /> -The autorouter will ensure both traces in the pair have the same length. +The constraint is passed to the autorouter. Supported autorouters try to add +length to the shorter route until the absolute difference is at most +`maxLengthSkew`. This only constrains routed length; it does not set pair +spacing or differential impedance. See the dedicated page for pin selectors, +reusable connector components, and troubleshooting. ## Net vs Direct connections