Hi,
I am trying to initialize canfd at 100kbps, but it doesn't work with this configuration:
while it works fine with 250/500/1000kbps. How do I configure it to work at 100kbps?
Thanks a lot !
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I am trying to initialize canfd at 100kbps, but it doesn't work with this configuration:
while it works fine with 250/500/1000kbps. How do I configure it to work at 100kbps?
Thanks a lot !
Hi,
Please follow the the formula provided in the CANFD test application to set the required bit rate.
C:\ti\mmwave_sdk_03_05_00_04\packages\ti\drivers\canfd\test\xwr18xx\main.c
/* Configuring 1Mbps and 5Mbps as nominal and data bit-rate respectively
Prop seg: 8
Ph seg 1: 6
Ph Seg2 : 5
Sync jump: 1
BRP(Baud rate Prescaler): 2
Nominal Bit rate = (40)/(((8+6+5)+1)*BRP) = 1Mhz
Timing Params for Data Bit rate:
Prop seg: 2
Ph seg 1: 2
Ph Seg2 : 3
Sync jump: 1
BRP(Baud rate Prescaler): 1
Nominal Bit rate = (40)/(((2+2+3)+1)*BRP) = 5Mhz
*/
Hi Jitendra Gupta,
As shown in the screenshot, I configured it according to this equation, when nomBrp=8, baud rate = (40)/(((8+6+5)+1)*8) = 0.25, 250kbps. So when nomBrp=20, the baud rate should be = (40)/((((8+6+5)+1)*20) = 0.1, 100kbps. but CANFD doesn't work at 100kbps after I configure it this way. Did I get something wrong?
Thanks!
Hi,
Is an error code returned by the driver? If so, could you share the error code?
Regards,
Aayush
Hi,
sorry for the delay.
I don't see any errors returned by the driver, it just doesn't work.
These are the configurations I use for 100kbps:
g_mcanBitTimingParams.nomBrp = 0x20U;
g_mcanBitTimingParams.nomPropSeg = 0x8U;
g_mcanBitTimingParams.nomPseg1 = 0x6U;
g_mcanBitTimingParams.nomPseg2 = 0x5U;
g_mcanBitTimingParams.nomSjw = 0x1U;
g_mcanBitTimingParams.dataBrp = 0x1U;
g_mcanBitTimingParams.dataPropSeg = 0x2U;
g_mcanBitTimingParams.dataPseg1 = 0x2U;
g_mcanBitTimingParams.dataPseg2 = 0x3U;
g_mcanBitTimingParams.dataSjw = 0x1U;
If I change the nomBrp from 20 to 8, CAN will work normally at 250kbps.
If I change the nomBrp from 20 to 16, CAN can not work at 125kbps.
Could you please give me a set of parameters to make can bus work at 100kbps or 125kbps?
Thanks a lot !
Hi,
I will bring this to Jitendra's attention. Please let him get back to you by tomorrow as he is on leave today.
Regards,
Aayush
Hi,
I have consulted with the team. Here is the response I received:
Could you try out Nominal Bit rate = (40M)/((((16+2+1)+1)*20)) = 100 kbps?
With your current configuration, the sampling point might be below 50%
Regards,
Aayush
Hi,
I tried this set of parameters, but it still not working at 100kbps.
Are there any other parameters I can try?
Thanks!
Hi,
Let me go back to the team with this and see if we can debug this further.
Regards,
Aayush
Hi,
We have not done further experimentation on this. I would recommend reading the TRM chapter on CANFD and experimenting with the values to get this working. I have spoken internally, and the team has indicated that CANFD should work with 100kbps, but some tuning would be required for the configuration.
Regards,
Aayush