CAN Bus Bit Timing Calculator — BRP, TSEG1, TSEG2 and sample point

Every valid TSEG1/TSEG2/SJW combination for your clock and bitrate, ranked by sample-point quality, with the register value.

Example: 500 kbit/s from a 36 MHz clock: BRP 9, TSEG1 6, TSEG2 1 — 8 tq per bit with a 87.5% sample point.

Check it against real silicon

Chiprun runs your firmware on an emulated microcontroller and hands back the UART output, so you can confirm these numbers rather than trusting them.

Chiprun docs

Formula

bit time = (1 + TSEG1 + TSEG2) × BRP / f_clk    sample = (1 + TSEG1) / total tq

Calculations follow ISO 11898-1.

Worked example

500 kbit/s from a 36 MHz clock: BRP 9, TSEG1 6, TSEG2 1 — 8 tq per bit with a 87.5% sample point.

  1. total tq = f_clk / (BRP × bitrate)

    36 MHz / (9 × 500 kbit/s)

    8 tq

    Must be a whole number, and between 8 and 25, for the controller to resynchronise.

  2. 1 (SYNC_SEG) + TSEG1 + TSEG2 = total tq

    1 + 6 + 1

    8

  3. sample point = (1 + TSEG1) / total tq

    (1 + 6) / 8

    87.5%

    Where in the bit the controller reads the level. Late is better for propagation delay, but leaves less room to resynchronise.

Frequently asked questions

What is the CAN sample point and why does it matter?

The position within each bit where the controller reads the level, expressed as a percentage. Every node must agree closely — two devices at the same bit rate but with sample points at 75% and 87.5% will produce intermittent errors that look like noise or bad termination. CiA recommends 87.5% for most rates.

Why do CAN peripherals need such specific clock frequencies?

Because the clock must divide into the bit rate by a whole number of time quanta, between 8 and 25. Frequencies like 16, 36 and 40 MHz are chosen precisely because they divide cleanly into standard CAN rates. An arbitrary clock often has no valid solution at all.

What is SJW?

Synchronisation jump width — how many time quanta the controller may shift a bit boundary to stay in step with the transmitter. It compensates for oscillator drift between nodes. It must not exceed TSEG2, and 1 tq is adequate for most designs with crystal-accurate clocks.

Should I prefer more time quanta per bit?

Generally yes, when the sample point comes out the same. More time quanta means finer resynchronisation steps and more tolerance of oscillator mismatch. The trade-off is that fewer combinations hit an exact sample point, so this tool ranks accuracy first and shows the alternatives.

Related tools