CAN Bus Transceiver Layout and Protection

A CAN bus is designed to be robust, which is exactly why problems on it are usually caused by the boards attached to it rather than by the protocol. Termination, stub length, grounding and protection are all board level decisions, and a node that violates any of them can disturb an entire network even when its own communication appears to work.

How a CAN Bus Is Wired

The bus is a differential pair with a nominal impedance of 120 ohms, driven by a transceiver on each node in a dominant and recessive signalling scheme. A dominant bit pulls the two lines apart and a recessive bit lets them return to a common level, so the wired AND behaviour of the pair resolves simultaneous transmissions without collision loss.

Both ends of the cable are terminated with a termination resistor equal to the line impedance, and no other node should carry one. The terminators absorb the reflections that would otherwise travel back down the bus, and their absence produces ringing that corrupts the bit sampling at the far nodes. Two resistors, one at each physical end of the bus, are part of the specification rather than an optional refinement.

The bus stub is the branch from the main line to each node. It should be as short as the data rate allows, because a long stub acts as an unmatched transmission line that reflects energy back into the bus. The classic guidance is a maximum stub of a few tens of centimetres at low bit rates and only a few centimetres at one megabit per second.

The Transceiver and Its Supply

A transceiver converts the single ended logic level of the controller into the differential bus levels, and it also provides the galvanic and common mode separation that the bus requires. Its supply must be well decoupled because the output stage switches the bus capacitance at the edge rate, drawing a current pulse from the rail on every transition.

Place the decoupling capacitor within a few millimetres of the transceiver supply pin, return it to the transceiver ground rather than to a distant plane, and add a small series resistor or ferrite where the rail is shared with switching circuitry. A transceiver that transmits into a long bus draws a larger current pulse than one that is idle, so a supply problem often appears only when the node is transmitting.

Some transceivers include a standby or silent mode that removes the driver from the bus. This is valuable during power up, because a node that drives the bus while its own supply is still rising can hold the whole network dominant. Controlling that pin from the controller rather than tying it to a fixed level gives the firmware a way to keep the node silent until it is ready.

CAN bus transceiver circuit on a controller board

Termination and Stub Length

Where a node is at the end of the bus, its termination resistor belongs between the two bus lines, placed as close to the connector as the layout allows. A resistor placed near the transceiver and connected by a long trace leaves the trace between the resistor and the connector as an unterminated stub, which is the very thing the termination is meant to prevent.

Split termination, with two resistors in series and a capacitor to ground at the midpoint, is common on automotive and industrial networks. The capacitor provides a low impedance path for common mode energy while the resistors maintain the differential termination, and the arrangement improves radiated emissions without affecting the differential signal.

The stub length for each node should be documented rather than left to chance. On a multi drop network with a backplane, the connector placement determines the stub length, so the mechanical design and the network topology have to be considered together. A node that communicates reliably alone may corrupt the bus when several nodes with long stubs are connected.

Protection for a Harsh Bus

The bus leaves the board and travels through an environment that may carry surges, shorts to supply rails and electrostatic discharge. Protection devices belong on the bus side of the transceiver, placed close to the connector, with a short return to ground. A common mode choke between the protection and the transceiver reduces the common mode energy that the pair carries.

The devices must be chosen for the bus voltage rather than for the logic supply. A transient suppressor that conducts at a few volts would load the bus during normal operation, while one rated for a much higher voltage would allow the transceiver input to be damaged before it clamps. Checking the standoff voltage against the maximum bus voltage, including the dominant state and any fault condition, is the first step.

A series resistor between the bus and the transceiver input is a common additional measure, but its value is limited by the input current of the device and by the required edge rate. Too large a resistor delays the transition and reduces the effective noise margin, so the transceiver datasheet should be checked before adding one. The general approach to protecting an exposed interface is set out in our article on EMI suppression design.

CAN bus interface with termination on a PCB

Grounding, Shielding and Isolation

The transceiver reference is the local ground, and the difference between the grounds of two nodes appears as common mode voltage on the bus. A transceiver with a wide common mode input range tolerates that difference, while one with a narrow range will misread the bus. Where the nodes are far apart or powered from different supplies, an isolated transceiver removes the problem entirely.

Cable shielding is useful but it has to be handled carefully. A shield connected at both ends carries the ground difference current through the shield, which reduces the common mode voltage at the expense of a large current in the screen. Connecting it at one end only removes that current but leaves the screen floating at the far end, where it can pick up charge. The choice depends on the installation, and it should be made once and applied consistently.

Where the board also carries analogue measurement, the bus interface belongs to the digital side of the partition, while the transceiver supply should still be treated as a noisy rail. The organisation of those areas is the same as for any mixed signal design, as described in mixed signal board design, and the bus connector should be kept away from any high impedance analogue node.

Layout of the Node

Keep the path from the transceiver to the connector short and direct, with the protection devices in line rather than on a branch. Route the two bus lines as a differential pair with a controlled impedance, keep them together through the connector escape, and avoid layer changes that would place one line on a different layer from the other.

Place the transceiver so that its ground pin has a short path to the local ground area, and keep the logic side away from the bus side. Where the transceiver is isolated, the barrier follows the same rules as any other isolation barrier: no copper crosses it except through the device, and the creepage requirement is determined by the working voltage between the two grounds.

Add a test point to each bus line for diagnosis, but place the test points on the connector side of the protection so that a probe cannot inject a transient past the clamps. This is a small detail that makes field diagnosis possible without risking the transceiver, and standard fabrication notes for that kind of feature are collected in manufacturable PCB design.

Debugging a Bus That Will Not Communicate

Measure the differential voltage on the bus with an oscilloscope rather than a meter. A recessive level near zero volts and a dominant level of about two volts indicate a healthy idle bus, while a level that sits near zero permanently means the bus is stuck dominant. That condition is nearly always caused by a node that is transmitting continuously or by a short between the two lines.

Check the termination by measuring the resistance between the two lines with the bus unpowered. Two 120 ohm terminators in parallel give 60 ohms, which is the correct reading for a network with both ends terminated. A reading of 120 ohms means one terminator is missing, and a much lower reading means one has been fitted at every node.

Finally, verify the bit timing and the sampling point with a protocol analyser. Errors that occur only at the ends of a long bus point to termination or stub problems, while errors that occur at specific nodes point to their transceiver supply or ground. Separating the two cases early prevents a great deal of unnecessary component replacement.

FAQ

Can I use more than two termination resistors? No. Only the two physical ends of the bus should be terminated. Additional resistors load the bus, reduce the differential amplitude and increase the current that each transceiver must drive.

How long can a CAN bus be? At 125 kilobits per second a bus of several hundred metres is practical, while at one megabit per second the practical length falls to a few tens of metres. The limit is set by the arbitration timing rather than by the cable alone.

Is an isolated transceiver always better? It is better wherever the nodes have separate grounds or the cable runs between buildings or cabinets. On a single board with a shared ground it adds cost without benefit.

Leave A Comment