CAN Best & Worst Case Calculator
Please read the disclaimer before using the output of this calculator.
Enter the CAN baud rate in kbps and the shortest and longest message used in your application, then click on the Calculate button
Bit Time, Message Length & Bandwidth
Notes:
- The max number of stuff bits used is a theoretical value representing an upper worst case boundry. See the last NOTE at the end of this page for an "average worst case".
- If a CAN controller receives an internal transmit request while a CAN message is in progess, it has to wait until the end of the message before it can try to arbitrate for the bus. In worst case, a low priority message might be currently on the bus while a high priority message needs to wait until the lower priority message is completed.
Required Interrupt Response Time
The message lengths give us a good idea about how often CAN messages occur and can trigger a receive interrupt at receiving nodes. However, that does not say anything about the receive buffering and the required interrupt response time.
Example: a CAN controller just issued a receive interrupt, because it received a frame with 8 data bytes that matched an acceptance mask/filter. Assuming the worst case, that back-to-back messages follow and are matching the same mask/filter - how much time is there to pick up the original received data, before it gets overwritten?
This table shows the worst case - how fast a message in the receive buffer can get overwritten by the next one. This time depends on how many buffers a CAN controller has.
Note: Depending on specific implementations the values above may vary. If an application's interrupt response time gets anywhere near to the values above, try to optimize the system.
Data Frame Transmission Times
Note: The following calculated values are all in microseconds, calculated by multiplying the bit time with the number of bits in the frame. The values do NOT include any stuff bits!
Note: The number of stuff bits inserted depends on the data transmitted. A conservative estimate is, that in average, the number of stuff bits will be below the following values:
- For 11-bit IDs: 3 + number of data bytes
- For 29-bit IDs: 5 + number of data bytes