CAN bit timing calculator

Prescaler, time quanta, sample point and register values for a clock and bit rate.

How to use it

  1. Enter the CAN controller’s clock and the bit rate you need.
  2. Choose a sample point, or keep the common default.
  3. Pick a solution and copy the prescaler, segments and SJW, or the STM32 bxCAN and SJA1000 register values.

Questions

What sample point should I use?

Around 87.5 % is the usual choice for classic CAN up to 500 kbit/s (CiA 301 recommends it), and around 75–80 % for the CAN FD data phase. Every node on a bus should use about the same.

Does it do CAN FD?

Yes: the arbitration and data phases have their own limits and results.

Which controllers get register values?

STM32 bxCAN (the BTR register) and SJA1000 (BTR0 and BTR1). For others, use the prescaler, time segments and SJW, which every controller takes in some form.

Related tools

  • Bus load calculator: Worst-case load of a message set, typed in or taken from a DBC file.
  • CAN frame on the wire (bit level): Every bit of a frame as CAN_H/CAN_L with stuffing and CRC; inject bit errors, decode captured bit streams, simulate arbitration.
  • UART baud rate calculator: BRR/UBRR divisor, actual baud rate and error for STM32, AVR and generic UARTs.
  • Timer prescaler and PWM calculator: PSC and ARR for a frequency or period, error, PWM resolution and CCR for a duty cycle.
  • Live bus: Your own CAN interface (Vector, PEAK, Kvaser, CANable, J2534 pass-thru…): trace, DBC decoding, UDS console, rest-bus simulation and test scripts. Listen-only until you allow sending.

Lessons that explain it

Also useful for: btr, baud, sample point, tseg, sjw, prescaler, brp.