CAN bus/The hall/Staying in step
Lesson 5 of 12 · in 3D and VR

Staying in step

There is no clock wire. Each device has its own oscillator and recovers the timing from the edges on the rail, restarting on the first edge of a message and nudging on the rest.

Lonely BinaryUpdated 2026-10-084 min readNo board required

View it in VR

Lesson 5 of the CAN bus course opens in a VR headset, on a table in front of you, and a voice starts three seconds after you arrive. Type this short address into the browser on a headset such as Meta Quest or Apple Vision Pro, and press Enter VR. No headset? Press Start the lesson: the same lesson, full screen.

learn.lonelybinary.com/vr/can/5

No clock wire

No wire tells the devices when to read. Each counts time with its own crystal, and all are set to the same bit rate. Two crystals at the same rate are never exactly the same. The original specification allows an oscillator to be off by about half a per cent, and a later change in it about one and a half, which is why devices use crystals and not simple RC oscillators.

Two devices one per cent apart slide a whole bit apart in a hundred bits, and then one reads a bit the other has left.

The first edge sets everyone together

A device with nothing to send waits for the rail to go from quiet to loud. That edge is the start of frame, and every waiting device restarts its bit count on it. This is hard synchronisation. It does not make the crystals equal, only the counts, at the moment that matters.

A device does not read at the edge, because the rail is still changing there. It reads at the sample point, about 75 to 87 per cent of the way through the bit. No single number is the rule, and ESP-IDF's ready-made 500 kbit/s timing for the ESP32 uses 80 per cent.

Later edges nudge

Each later quiet-to-loud edge that arrives a little early or late tells a device its count has drifted. It lengthens or shortens its current bit by a small amount, never more than a set jump, at most once per bit. This is resynchronisation, and it holds the devices together to the end of the message.

It needs edges to keep coming. The longest gap the specification counts on is 29 bit times, and lesson eight shows how a message makes sure of it.

The rail takes time

A signal covers about five nanoseconds a metre, so the far end sees every edge late. A sender must still hear another device's loud bit before its own sample point, which limits how long a rail can be at a given speed. Lesson eleven comes back to it.

Common mistakes

  • Looking for the clock. There is none. Each device has its own crystal and recovers the timing from the edges.
  • Treating the sample point as one fixed number. It is a setting, about 75 to 87 per cent of the bit.
  • Setting two devices to different bit rates and expecting synchronisation to cope. It corrects a small drift at the same rate. A device at another rate sees edges in the wrong places and reports errors.

Edit this page — content/fundamentals/can/staying-in-step.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Fundamentals on the forum →