Introduction
KiCad is a popular open source printed circuit board (PCB) design software that allows engineers to layout and route boards. One common task when designing high speed digital circuits is routing differential pairs to carry signals like USB, HDMI, PCIe etc. Differential signaling improves noise immunity and helps prevent electromagnetic interference (EMI).
In this comprehensive guide, we will cover how to create and route differential pairs in KiCad:
Table of Contents
- What are Differential Pairs and Why Use Them?
- KiCad Differential Pair Routing Settings
- Creating a Differential Pair
- Routing a Differential Pair
- Length Matching and Phase Delay
- Adding Vias and Changing Layers
- Checking Differential Impedance
- Other KiCad Differential Pair Tools
- Common Mistakes and Best Practices
- Frequently Asked Questions
So let’s get started with understanding what differential signals are and why they are useful.
What are Differential Pairs and Why Use Them?
A differential pair is a technique where two traces carry equal and opposite signals. The receiver measures the voltage difference between the two lines to determine the signal level.
Some key advantages of differential signaling are:
- Noise immunity – Common mode noise equally affects both lines. So the voltage difference at receiver is not impacted.
- Lower EMI – Equal and opposite currents cause electromagnetic fields to cancel out, reducing emissions.
- No reference required – Differential signaling does not need a voltage reference. Only the relative voltage matters.
Due to these benefits, high speed data transmission over long distances relies on differential pairs. Some common differential interfaces are:
- USB
- HDMI
- PCI Express
- SATA
- RS-485
The distances and data rates require careful routing to maintain signal integrity. Tiny differences in trace length or impedance will degrade the signal quality and introduce errors.
KiCad provides powerful tools to assist in routing properly matched length and impedance controlled differential pairs. Let’s look at the settings next.
KiCad Differential Pair Routing Settings
To access the configurable options for differential pair routing, open the Preferences > Board Editor Settings dialog box:
The important parameters are under High Speed section:
- Length tuning stubs – Enable adding tuning stubs during interactive routing to match lengths.
- Ref track width – The default width when creating new differential pair traces.
- Ref track gap – The initial gap between the two traces in a differential pair.
Length tuning stubs help match the trace lengths within a differential pair. The board editor will automatically add serpentine sections during routing when enabled.
The Ref track width and Ref track gap set the starting dimensions for a new differential pair. Typically the traces have a matched width and small gap. For example, common defaults would be 0.25mm width and 0.25mm gap.
Adjust these settings as needed for your specific PCB stackup and differential trace impedance requirements.
For high speed designs, you should also check the High Speed Design Rule settings under Design Rules. This section controls the matching tolerances for length, impedance, and other parameters.
With the preferences configured, we can now look at creating a new differential pair.
Creating a Differential Pair
A differential pair can be created in the PCB editor in two ways:
- Draw two new tracks and convert to differential pair
- Add a new differential pair trace
To convert existing tracks:
- Draw two single tracks side by side with the desired spacing
- Select both tracks
- In the Tracks and Vias toolbar, click the Pair button
This pairs the tracks and enables the length tuning stubs.
To create a new differential pair:
- Switch to differential pair routing mode using the DP button in the toolbar
- Set the desired width and gap based on your impedance needs
- Click and route the differential pair as required
The new pair will have the default dimensions defined in the preferences. You can change the values by selecting the pair and modifying the Width and Gap properties.
Now we can route the differential pair across the PCB.
Routing a Differential Pair
When routing a differential pair, there are a few techniques to follow:
- Route with equal length traces
- Minimize vias and layer changes
- Avoid acute angles
- Enable length tuning stubs
- Verify routing with length tuning graph
Follow these steps to route:
- Enable Ratsnest lines in the toolbar to see unrouted connections
- Select the differential pair layer from the layer toolbar
- Click on the starting point of the differential pair
- Route across the PCB to the destination
- Trace the most direct path between points
- Allow the autorouter to handle some of the routing
- Avoid vias and layer changes for now
- As you route, the Length Tuning Stub traces will be automatically added to match the lengths
- Right click to finish routing the pair
If enabled in the preferences, the length tuning stubs help match the traces within a few thousandths of an inch.
Next we will look at managing the overall trace length matching.
Length Matching and Phase Delay
In order for the differential signals to be accurately received, the two traces must be closely matched in length. Even sub-millimeter differences in trace length can introduce data errors at high speeds.
KiCad provides two tools to visualize and tune the lengths:
- Length Tuning Information dialog
- Phase Delay Gauge – Shows delay skew between traces
To check the length matching in the PCB Inspector Panel, click the Length Tuning Information button:
This shows the minimum, maximum, and skew values for the currently selected differential pairs. The target is to minimize the skew close to zero.
The Phase Delay Gauge is another useful tool. It displays dynamically as you route and highlights the real-time phase delay skew. Clicking on a trace also shows the length.
Use these two tools in combination to match the lengths within tight tolerances. Some additional tips for length matching:
- Route critical signals as short as possible
- Make use of meanders and tuning stubs
- Be mindful of fanout lengths from drivers
- Keep paired lengths symmetric on circuit schematic
With the basic routing complete, we may need to add vias or change layers. This is covered next.
Adding Vias and Changing Layers
For longer connections, we may need to add vias to change routing layers or avoid obstacles.
Here are some tips when adding vias to differential pairs:
- Minimize the number of vias
- Use dual vias to maintain symmetry
- Repeat the via stackup on both traces
- Ensure consistent spacing through vias
To add symmetric vias:
- Select one trace and place a via
- Copy the via (Ctrl+Drag) and paste to the other trace
- Route the traces on the next layer
This maintains the balanced routing. If more vias are required, repeat the process.
When changing layers, the phase delay gauge is useful to match the lengths. Route a short jog on the new layer to compensate for any skew.
Checking Differential Impedance
In addition to matching lengths, we also need to match the impedance on the differential pair.
The impedance depends on the PCB stackup, trace geometry, and proximity to other traces. It is important to verify impedance against your target, usually around 100 ohms.
KiCad provides an impedance tuning tool for this. To check impedance:
- Select the differential pair
- In the Tracks and Vias toolbar, click the Impedance Profile button
This displays an impedance graph over the length of the traces. Look for sections that deviate from your target.
To correct impedance problems:
- Adjust the trace width and gap
- Move traces away from disruptive nearby traces
- Isolate sections on inner layers with ground planes
Continue tuning the geometry until the impedance profile reaches the desired target.
Other KiCad Differential Pair Tools
KiCad includes additional useful features when working with differential pairs:
- Automatic length matching – Enables dynamically tuning lengths during placement and routing.
- Differential pair dimensions – Set width, gap, via gap etc globally or per pair.
- Trace length calculations – Calculates the electrical length for phase delay and impedance calculations.
- Sweep tuning tool – Helps identify resonance points when tuning stub lengths.
- Rule checking – Validates length tuning, phase matching and geometry constraints.
Make use of these tools throughout the layout process to simplify differential pair routing. The end goal is matching the lengths and impedances accurately.
Common Mistakes and Best Practices
Let’s now review some best practices and common mistakes to avoid:
Best Practices
- Keep paired nets length matched in schematic
- Minimize vias (use dual vias if needed)
- Avoid acute angles
- Use length tuning stubs
- Tune lengths and impedance
- Isolate pairs on inner layers
Common Mistakes
- Not checking high speed design rules
- Disabling length tuning stubs
- Setting width/gap wrongly for impedance
- Tuning lengths without impedance matching
- Having too many vias or uneven vias
- Unbalanced trace geometries
- Running near disruptive signals
Following the steps outlined in this guide and leveraging KiCad’s features will help avoid these mistakes.
Some key takeaways:
- Carefully configure the preferences
- Route short direct paths
- Visualize length and impedance mismatches
- Iteratively tune to meet constraints
This requires some trial and error, but the visual tools make it much easier.
Frequently Asked Questions
Here are some common questions about routing differential pairs in KiCad:
1. What is the typical trace width and gap for differential signals?
For common stripline stackups, a width/gap of 6/6 mils (0.15/0.15 mm) provides ~100 ohms differential impedance. But always use a calculator to compute the width and gap needed for your specific PCB parameters.
2. How small a length difference is acceptable?
Ideally you want less than 0.5 mm length mismatch within a pair. The tolerance depends on data rate – faster signals require tighter matching. Enable high speed design rules and follow the constraints.
3. Should I use a ground plane next to differential traces?
Yes, use ground planes on adjacent layers if possible. This provides isolation and ensures consistent impedance referenced to ground. Avoid routing differential pairs in isolation.
4. Can I route perpendicular segments on a differential pair?
Avoid 90 degree and acute angles if possible. Gradual turns help maintain proper impedance and reduce reflections. Right angles are acceptable if properly mitigated.
5. When should I use impedance tuning vs length tuning?
Use length tuning to match the trace lengths. Impedance tuning is for targeting the desired differential impedance along the pair. Enable both for best results.
Conclusion
Properly routing differential pairs is essential for high speed designs. KiCad provides powerful tools to simplify the process and help you achieve the required constraints. A methodical approach of planning the pairs, following best practices, and iteratively tuning will result in clean routing with matched lengths and impedance.
The key takeaways from this guide are:
- Understand basics of differential signaling
- Configure preferences and design rules
- Minimize vias and acute angles
- Visualize and tune length matching
- Verify and adjust impedance profiles
- Leverage KiCad’s differential pair toolset
Using these steps and techniques will help you successfully route differential signals and avoid common mistakes. Thanks for reading! Please leave any questions in the comments.