How to calculate BRP for specific clock frequency and specific bit rate?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to calculate BRP for specific clock frequency and specific bit rate?

3,333 Views
lpcware
NXP Employee
NXP Employee

For the bit rate first determine the number of time quanta (TQ) required. There is often a recommended number for each bit rate. Use the bit rate calculator at http://www.esacademy.com/en/library/calculators/sja1000-timing-calculator.html,

enter the core (or CAN peripheral) clock frequency and the desired bit rate. The table CiA Recommended Values will give the number of TQ. Also make a note of the recommended sample point.
The TQ needs to be divided up into three groups, SYNC, TSEG1 (sometimes also given as Propagation Segment plus Phase Segment 1) and TSEG2 (sometimes also called Phase Segment 2). SYNC always consists of one TQ. The sample point is at (SYNC + TSEG1) / TSEG2. As you can see, the distribution of TQ affects the sample point. Try to get as close to the recommended sample point as possible. If this is not achievable, increase the number of TQ.
The core (or CAN peripheral) clock needs to be divided down into one TQ. For example if the CAN bit rate is 1Mbps and the number of TQ is eight, then a single TQ is 125ns (8MHz). If the core clock is 48MHz then the CAN prescaler needs to be 48MHz / 8MHz = 6.
If the core clock cannot be precisely divided into a single TQ then increase the number of TQ.
Going back to the online calculator a recommendation for the synchronization jump width (SJW) is given in number of TQ. Typically it is two TQ.
For CAN-FD the entire process is repeated again but for the higher data bit rate. The data bit rate and the nominal bit rate will be clocked from the same source but have different prescalers.

"FAQ contribution from Embedded Systems Academy, experts in CAN bus. For more information visit www.esacademy.com"

Labels (1)
Tags (1)
0 Kudos
Reply
0 Replies