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.
Formula
bit time = (1 + TSEG1 + TSEG2) × BRP / f_clk sample = (1 + TSEG1) / total tqCalculations 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.
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.
1 (SYNC_SEG) + TSEG1 + TSEG2 = total tq
1 + 6 + 1
8
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
UART Baud Rate Error Calculator
Register value and percentage error for any MCU clock and baud rate, with a verdict on whether the link will actually be reliable.
Firmware
Modbus RTU Frame Builder
Build and decode Modbus RTU frames with automatic CRC, function-code reference and error decoding.
Firmware
Clock Tree & PLL Configurator
Solve PLL M/N/P/Q dividers for a target system clock from your crystal, respecting each stage's legal range.
Firmware
Timer & Prescaler Calculator
Every valid prescaler and reload pair for a target frequency on AVR, STM32, PIC and RP2040 — ranked by error, with C you can paste.
Firmware
Hex, Binary & Decimal Converter
Convert between hex, binary, decimal, octal and ASCII, with width-aware bit grids and endianness swapping.
Firmware
Bitwise Operation Calculator
AND, OR, XOR, NOT and shifts with a live bit grid so you can see exactly which bits moved.
Firmware