Bit rate calculation for CAN FD

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

Bit rate calculation for CAN FD

7,413 Views
nitinverma
Contributor III

We are using s32k144 evaluation board.

Currently we are using standard CAN with 500 Kbps. 

/* Macros for CAN_Baudrate setting */
BAUDRATE_PROPSEG = 4u
BAUDRATE_PHASESEG1 =  7u
BAUDRATE_PHASESEG2  = 1u
BAUDRATE_PREDIVIDER = 0x00u
BAUDRATE_RJUMPWIDTH = 1u

This setting is working well.

But now we need to use it for CAN FD with data phase as 2 Mbps. Please let us know what values we need to pass for the above parameters.

 

Thanks

Nitin

Labels (1)
13 Replies

4,376 Views
nitinverma
Contributor III

clock used for the CAN engine is oscillator clock with 8Mhz frequency

0 Kudos

4,376 Views
PetrS
NXP TechSupport
NXP TechSupport

Yes, you can get some setting with the link you provided, but it does not follow basic rules given in The Configuration of the CAN Bit Timing. The PHY interface and bus length must be also considered to get proper PROPSEG value, etc.

You can try e.g this simple guide (https://community.nxp.com/docs/DOC-330446) for Standard CAN bit timing calculation.

Regarding the FD bit time calculation; it is recommended to have the same time quanta length for the data phase and set the sample time somewhere in the middle of the data bit time.

 

For the 8Mhz protocol clock and your desired 2Mbps for data phase you do not get valid setting. Minimum time quanta is 5, while with 8Mhz clock you get only 4 time quanta per bit. You need to increase protocol clock to be able to have 2Mbps data phase.

 

For the example link; I see the file within this thread….

pastedImage_1.png

BR, Petr

0 Kudos

4,376 Views
nitinverma
Contributor III

Thanks for the help. But we are not able to see the attached "S32K144_FRDM_CAN_FD_Demo_RevC.zip". Could you please upload this again.

0 Kudos

4,376 Views
PetrS
NXP TechSupport
NXP TechSupport

here it is again...

BR, Petr

0 Kudos

4,376 Views
guenter_loettrich
NXP Employee
NXP Employee

Hi Petr,

would it be possible to provide a specialized CAN-FD bittiming calculator?

There is AN5408 available for clock calcualtions on S32K but unfortunately the FlexCAN module is not considered.

Would be really helpful if that one could be enhanced for standard CAN and CAN-FD clocking calculations.

br

Guenter 

0 Kudos

4,376 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Guenter,

yes, I am planning to create some document/excel this year, but not sure how fast I will be. We have quite enough work (Cases, community etc) in past days/weeks/months.

The AN5408 does not deal with the CAN timing, only provide module/protocol clock.

BR, Petr

0 Kudos

4,376 Views
nitinverma
Contributor III

Thanks Petr, Now we are able to see the attached file, may be there was some browser issue.

4,376 Views
nitinverma
Contributor III

We are still not able to see or download the attached zip file. Could you please mail us the zip file at nitinkumar.verma@tcs.com 

12.PNG

0 Kudos

4,376 Views
ivadorazinova
NXP Employee
NXP Employee

Hi Nitin,

Strange issue, after ctrl+f5 is still not visible? What browser are you using?

I cannot reproduce it on my side.

please could you download it from https://community.nxp.com/servlet/JiveServlet/download/850381-1-395567/S32K144_FRDM_CAN_FD_Demo_RevC... ?

Best Regards,

Iva

0 Kudos

4,376 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Nitin,

Your bit rate setting is not correct, or better does not follow CAN standard. It can work, but it is not CAN standard compliant.

See attached simple example configuring CAN module to send FD message. The bit timing config is dine in InitCAN() function. A 40MHz bus clock is selected for engine clock.  

BR, Petr

0 Kudos

4,376 Views
nitinverma
Contributor III

Hi Petr,

PFA the link from where I got the values for 500 kbps with 8Mhz frequency for standard CAN.

http://www.bittiming.can-wiki.info/ 

Here the device I have selected as NXP(Freescale)FlexCAN, and got the following mentioned values.

Now, I need the values for CAN FD with data phase as 2mbps and clock is 8Mhz. As per your reply I did not find any attached example,Can you please send it once again.

Thanks

Nitin

0 Kudos

4,376 Views
raresvasile
NXP Employee
NXP Employee

Hi Nitin,

What is clock is used for the CAN engine(PE clock) ?

Rares

0 Kudos

4,376 Views
nitinverma
Contributor III

clock used for the CAN engine is oscillator clock with 8Mhz frequency

0 Kudos