Search topics...
CANBit Timing and Synchronizationfoundational

How does CAN bit timing work? What is the sample point and why does it matter?

0 upvotes
Practice with AISoon
Study the fundamentals first — CAN topic page

CAN is an asynchronous protocol — each node has its own local oscillator, and there is no shared clock wire. Nodes stay synchronized by resynchronizing on signal edges within the data stream (enabled by bit stuffing, which guarantees edges at least every 5 bit times).

Each bit period is divided into segments measured in time quanta (TQ) — the fundamental timing unit derived by dividing the CAN controller's clock by a prescaler. A single bit consists of four segments:

  1. Sync Segment (SYNC_SEG) — always 1 TQ. The expected edge transition occurs here.
  2. Propagation Segment (PROP_SEG) — compensates for physical propagation delays (signal travel time across the bus and through transceivers). Typically 1-8 TQ.
  3. Phase Segment 1 (PHASE_SEG1) — can be lengthened by the resynchronization mechanism. Typically 1-8 TQ.
  4. Phase Segment 2 (PHASE_SEG2) — can be shortened by resynchronization. Typically 1-8 TQ.

The sample point is the instant when the bus level is read and interpreted as the current bit value. It is located at the boundary between Phase Segment 1 and Phase Segment 2. Its position within the bit period (expressed as a percentage) is critical:

  • Too early (e.g., 50%): the sample occurs before the signal has fully settled after propagation delays, risking sampling a transitioning signal.
  • Too late (e.g., 95%): leaves almost no Phase Segment 2, reducing the tolerance for oscillator drift and making resynchronization less effective.
  • Optimal: typically 75-87.5% for automotive CAN. The CiA (CAN in Automation) recommends 87.5% for CAN networks up to 125 kbit/s and shorter buses, and 75% for 1 Mbit/s networks.

Practical calculation example: for 500 kbit/s CAN with a 16 MHz oscillator, prescaler = 2, giving TQ = 125 ns. A bit period of 2 us = 16 TQ. Configuration: SYNC_SEG = 1, PROP_SEG = 5, PHASE_SEG1 = 6, PHASE_SEG2 = 4. Sample point = (1+5+6)/16 = 75%.

Getting the sample point wrong is a common cause of intermittent CAN errors, especially when mixing nodes from different vendors with different oscillator tolerances.

Source: CAN Q&A