Protocol calculator

CAN Bit Timing Calculator

CAN bus time quantum, bit segments, sample point, actual bitrate, and timing error.

CAN bus timing parameters

Calculate tq, TSEG values, sample point, actual bitrate, and baud-rate error.

SJW must fit within the controller limit, usually no larger than phase segment 2.
Actual bitrate
500.00 Kbps
Sample point
87.50%
Time quantum
125.0 ns
Total tq / bit
16
Bit time
2.000 us
Bitrate error
0.000%

This timing is in the common 75-87.5% sample-point range. Map the fields to your MCU register names before flashing firmware.

Formula notes

Classic CAN bit timing is built from one sync segment plus the programmable propagation and phase segments. Total tq = 1 + PropSeg + PhaseSeg1 + PhaseSeg2, and bitrate = clock / (prescaler * total tq).

What this calculator is for

Use this CAN bit timing calculator when you need to check whether a controller clock, prescaler, and segment split can produce a target bus speed such as 125 Kbps, 250 Kbps, 500 Kbps, or 1 Mbps.

The tool reports the physical timing values first. It does not pretend that every STM32, NXP, Microchip, or other CAN controller stores those values in the same register layout.

Sample point planning

The sample point is where the receiver reads the bus level inside each bit. A later sample point can help on longer buses because propagation delay consumes part of the bit time, but a point too close to the end leaves less room for resynchronization.

Worked example

With a 40 MHz CAN clock, prescaler 5, propagation segment 7 tq, phase segment 1 at 6 tq, and phase segment 2 at 2 tq, the total is 16 tq. The actual bitrate is 500 Kbps, each tq is 125 ns, and the sample point is 87.5%.

Before programming registers

  • Check whether the vendor register stores raw segment values or minus-one encoded values.
  • Confirm whether a field named TSEG1 combines propagation segment and phase segment 1.
  • Keep SJW inside the controller limit and no larger than phase segment 2 unless the datasheet says otherwise.
  • Verify oscillator tolerance, bus length, transceiver delay, and termination before blaming software timing.

Frequently asked questions

What is a good CAN bus sample point?

A common target is between 75% and 87.5% of the bit time. Many CANopen, DeviceNet, and general industrial examples use 87.5%, but the best point depends on bus length, transceiver delay, oscillator tolerance, and the controller timing limits.

How do I calculate CAN baud rate from timing parameters?

Add one sync segment, propagation segment, phase segment 1, and phase segment 2 to get total time quanta per bit. The actual bitrate is controller clock divided by prescaler and total time quanta.

What is time quantum in CAN bit timing?

The time quantum, often written as tq, is the base timing unit used by the CAN controller. It is derived from the CAN peripheral clock and baud-rate prescaler.

Should SJW be larger than phase segment 2?

No. Sync jump width should not exceed phase segment 2 on typical CAN controllers. Keep it small enough for the controller rules in the datasheet.

Why does a CAN timing calculator differ from my MCU register values?

Vendors name and pack timing fields differently. Some registers store minus-one values, and some call propagation plus phase segment 1 by a combined name such as TSEG1. Use the calculator for timing math, then map the result through the MCU reference manual.