2024-09-19 01:29 AM
Hi, I am currently trying to set the data time of the can_fd function to 8Mbps for can_fd communication.
However, when I set the data time to be 8Mbps, the communication does not proceed normally.
When I set the data time to 1,2,4,5 Mbps, it worked fine, but why does it not work when I set it to 8 Mbps?
I have attached the IOC file in the attachment.
+ i already tried to change the data times into 5/4 , 6/3 but it didn't worked
Solved! Go to Solution.
2024-09-20 06:43 AM - edited 2024-09-20 06:44 AM
Hello @KDG ,
Watch this video on youtube, how to configure FDCAN timings especially @13:57
You need to use kvaser calculator from here: https://kvaser.com/support/calculators/can-fd-bit-timing-calculator/
Node delay to be put here:
2024-09-19 01:40 AM
You have to compensate the transceiver delay, there's a register setting for that.
No idea how to set this with Cube.
/* enable TDC = transmitter delay compensation
* this is a MUST for high data rates
*/
/* configure Tx Delay Compensation : TdcOffset = DataTimeSeg1 * DataPrescaler */
uint32_t u32TdcOffs = ((uint32_t)phCan->Instance->DBTP >> FDCAN_DBTP_DTSEG1_Pos) + 1;
uint32_t u32TdcFltWdw = 0;
/* set TDC filter window */
phCan->Instance->TDCR = (u32TdcFltWdw << FDCAN_TDCR_TDCF_Pos);
/* set TDC offset */
phCan->Instance->TDCR |= (u32TdcOffs << FDCAN_TDCR_TDCO_Pos);
/* enable TDC */
phCan->Instance->DBTP |= FDCAN_DBTP_TDC;
2024-09-19 01:44 AM - edited 2024-09-19 01:46 AM
Hello,
You are using Normal mode.
What is the transceiver part number you are using? Is it supporting 8Mb/s bandwidth?
Did you try the Loopback mode?
2024-09-19 05:00 PM
The transceiver is TCAN341x, and it says it supports 8Mbps in its datasheet
"Support of classical CAN and optimized CAN FD performance at 2, 5, and 8 Mbps"
No, I didn't tried the Loopback mode, can it be used for this solution?
2024-09-19 05:04 PM
In the datasheet it says
"Without transceiver delay compensation, the bitrate in the data phase of a CAN FD frame is limited by the transceivers loop delay"
you are saying that this could be the cause of my error?
2024-09-19 10:51 PM
Ohh... so the transceiver delay compensation is needed when using the can fd data time which is over 5Mbps.
after when i added the transceiver delay compensation, a waveform with a size about 192ns is added before the err waveform occured.
I think by adjusting the delay compensation setting, my problem could be solved, but I can't find the guidelines for setting it, Is there any guidelines for it?
2024-09-20 03:11 AM
It's all in the reference manual, and register description. It's all calculated as "mtq".
And it depends on the actual transceiver chip, which has its delay in ns usually in its datasheet.
2024-09-20 06:43 AM - edited 2024-09-20 06:44 AM
Hello @KDG ,
Watch this video on youtube, how to configure FDCAN timings especially @13:57
You need to use kvaser calculator from here: https://kvaser.com/support/calculators/can-fd-bit-timing-calculator/
Node delay to be put here: