CAN Bus Bit Timing Calculator
Calculate CAN bus bit timing parameters including prescaler, time quanta, sync segment, propagation segment, and phase buffer segments for a given baud rate and sample point
ISO 11898-1 bit segments and clock tolerance · prescaler closest to the bit rateAPI slug can-bus-timing
Inputs
One bit in time quanta
sample point · Actual Sample Point SPset 87.5 %
Standard values of CAN Baud Rate
Select a row to use it| CAN Baud Rate | Prescaler | Nominal Bit Time | Bit Rate Error | Status |
|---|---|---|---|---|
| 300 | 16tq | 0.00% | PASS | |
| 150 | 16tq | 0.00% | PASS | |
| 60 | 16tq | 0.00% | PASS | |
| 24 | 16tq | 0.00% | PASS | |
| 12 | 16tq | 0.00% | PASS | |
| 6 | 16tq | 0.00% | PASS | |
| 4 | 15tq | 0.00% | PASS | |
| 3 | 16tq | 0.00% | PASS |
- Sync SegmentSS
- 1tq
- Propagation SegmentPROP
- 6tq
- Phase Buffer 1 (BS1)BS1
- 7tq
- Phase Buffer 2 (BS2)BS2
- 2tq
- Clock Tolerance AllowedΔf
- 0.313%
Formula
| Symbol | Quantity | Your value |
|---|---|---|
| tq | Time quantum (ns) | 125 ns |
| BRP | Baud rate prescaler | 6 |
| NBT | Nominal bit time in TQ (tq) | 16 tq |
| SS | Sync segment (1 tq) (tq) | 1 tq |
| BS1 | Phase buffer segment 1 (tq) | 7 tq |
| BS2 | Phase buffer segment 2 (tq) | 2 tq |
Assumptions
5 items
- 01A bit holds 8 to 25 time quanta (CAN 2.0, part B, section 8): a sync segment of one quantum, then the propagation segment and phase 1, which share the quanta before the sample point (propagation the smaller half), and phase 2 after it. The quantum is the prescaler over the clock.
- 02The prescaler and quanta are, of every bit of 8 to 25 quanta with the prescaler on either side of the one it calls for, the closest to the bit rate; then the sample point nearest the one asked for (CiA 601-3); then nearest 16 quanta; then the smallest prescaler. A controller's register range (a ten-bit prescaler on bxCAN) is not checked.
- 03The sample point lies at the nearest whole quantum to the percentage asked for, a half up, and at the latest a quantum before the end of the bit, so phase 2 always keeps a quantum and the segments add up to the bit.
- 04The clock tolerance allowed is ISO 11898-1's: the smaller of min(PS1, PS2)/(2·(13·NBT − PS2)) and SJW/(20·NBT), each node's deviation from nominal. The synchronisation jump width used is at most the shorter phase segment.
- 05The bit-rate error comes from the whole-number prescaler and quanta, and adds to the oscillator's own tolerance; the page passes it while it is within the tolerance the bit timing allows, which leaves the oscillator's share to you. Classical CAN only: no CAN FD data phase, and the bus's propagation delay (cable and transceivers) is not checked against the propagation segment.
Worked example
STM32F1 CAN at 36 MHz, 500 kbps
An STM32F1's CAN controller runs from its 36 MHz APB1 clock on a 500 kbps bus sampled at 87.5 %. Which prescaler and how many quanta, where does it really sample, and how much clock error does the timing allow?
| Step | Expression | Result |
|---|---|---|
| Quanta and prescaler | 36 MHz/500 kbps = 3 × 24 | 3 |
| Time quantum | 3/36 MHz | 83.33 ns |
| Segments | SYNC_SEG 1 + PROP_SEG 10 + PHASE_SEG1 10 + PHASE_SEG2 3 | 24 tq |
| Sample point | (1 + 10 + 10)/24 | 87.5 % |
| Clock tolerance allowed | min(min(10, 3)/(2 × (13 × 24 − 3)), 1/(20 × 24)) | 0.208 % |
How it works
This calculator determines CAN bus bit timing parameters for automotive and industrial networks. Embedded engineers and automotive system designers use it to configure CAN controllers per ISO 11898-1 (CAN 2.0) and ISO 11898-2 (high-speed physical layer) specifications. The bit time is divided into 4 segments: Sync_Seg (always 1 TQ), Prop_Seg (1-8 TQ for propagation delay compensation), Phase_Seg1 (1-8 TQ), and Phase_Seg2 (1-8 TQ). The sample point, where the bus level is read, should be positioned at 75-87.5% of the bit time per ISO 11898-1:2015 Section 11.3.1.1 (Road vehicles — Controller area network — Part 1: Data link layer and physical signalling) and ISO 11898-2:2016 (Physical medium attachment layer). CAN FD timing is specified in ISO 11898-1:2015 Amendment 1. For a 500 kbps network (the most common automotive rate), bit time is 2 microseconds. With an 80 MHz clock and 8-16 time quanta per bit, achievable prescaler values range from 10-20. CAN FD extends speeds to 2-8 Mbps in the data phase, requiring sample points of 70-80% and tighter oscillator tolerance (0.1% versus 0.5% for classic CAN).
Practical tips
- Per ISO 11898-2, use 87.5% sample point for networks under 40 meters, reduce to 75% for networks 40-500 meters to accommodate propagation delay
- Set SJW (Synchronization Jump Width) to the maximum allowed value (typically 1-4 TQ) to tolerate oscillator drift up to 1.58% per Bosch CAN specification
- For CAN FD at 2 Mbps data phase, use transceiver propagation delay <150 ns (TJA1042 family) and keep stub lengths under 30 cm
Common mistakes
- Using mismatched bit timing between nodes - even 1 TQ difference causes sample point mismatch, increasing error frames by 10-50x on bus lengths >20 meters
- Setting sample point above 90%, which violates ISO 11898-1 and causes 5-15% error rate on multi-node networks due to insufficient Phase_Seg2
- Neglecting oscillator tolerance - ceramic resonators (0.5% accuracy) fail at cable lengths >50 meters while crystals (20 ppm) support the full 1 km range
Frequently asked questions
3 questions
What is the typical CAN Bus bit rate?
ISO 11898 defines rates from 10 kbps to 1 Mbps. Automotive uses 500 kbps (powertrain CAN) and 125 kbps (body CAN). Industrial networks use 250 kbps (DeviceNet) and 125 kbps (CANopen). CAN FD extends data phase to 2-8 Mbps while arbitration remains at 500 kbps.
How do time quanta relate to bit timing?
Time quantum (TQ) is the smallest timing unit, derived from CAN clock via prescaler: TQ = Prescaler / f_CAN. Each bit contains 8-25 TQ (typically 16 for optimal adjustment). With 80 MHz clock, prescaler=10 gives TQ=125 ns, yielding 2 us bit time (500 kbps) with 16 TQ.
Why is sampling point important in CAN Bus?
Per ISO 11898-1, all nodes must sample the bus at consistent points to read the same bit value. A sample point at 87.5% provides 12.5% margin for signal settling after propagation. Too early (75%) wastes margin; too late (>90%) risks sampling during bit transition, causing 100% arbitration failures.
Shop Components
As an Amazon Associate we earn from qualifying purchases.