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.
Hello,
The bit rate switch is not working, I used the configuration provided here:
e2e.ti.com/.../am2634-tmdscncd263
When I disable the bit rate switching it works fine.
Also, the provided example in the MCAL was not working with the bit rate switching.
Yours,
The bit rate switch is not working
Does you mean the CAN communication doesn't work for bdrate =100kbps/500kbps?
When you change the baudrate, you have to change the length of the segments. According to the CAN specification, the CAN Bit time is divided into four segments:
The baudrate = CAN_CLK (80MHz) / (BRP)(1+TSEG1+TSEG2)
Did you change the length of segments accordingly?
Hello,
I am using the configuration provided by TI support here
But the communication is not working with bit rate switch enabled
Yours,
Hi Afifi,
The number of the segments are not correct for new baudrate configuration.
Okay, can you provide a working configuration instead of the provided one from TI support?
You can calculate the bit timing using this tool from TI:
https://www.ti.com/lit/zip/sprac35
or the tool from PEAK system:
https://www.peak-system.com/Bit-Rate-Calculation-Tool.496.0.html?&L=1
The ti .xls does not calculate values for CAN FD.
Also, the provided example in the MCAL does not work with bit rate switch enabled.
Is this a known bug or what?
Please those values:
/* Baud Rate Structure for all configsets */
static Can_BaudConfigType CanConfigSet_CanController_0_CanControllerBaudrateConfig_0 =
{
100U, /* in KB */
20U, //propogation
9U, //seg1
9U, //seg2
1U, //sync
39U, /* Sum of all timing parameters */
20U, /* Controller BRP value for Baud */
/* Data phase Baudrate */
{
500U, /* in KB */
23U,
9U,
9U,
1U,
39U, /* Sum of all timing parameters */
4U, /* Controller BRP value for Baud */
180U,
(boolean)TRUE
}
};
Thanks i will try this configuration to see if the bit rate switch will work or not.
If it works, I will ask you for a configuration with speed(500/2000) like the previous one provides from ti support but with a working bit rate switch this time.
Let me know your test result.
You can calculate the values using the formula: baudrate = CAN_CLK (80MHz) / (BRP)(1+TSEG1+TSEG2)
Hello Wang,
This configuration is not working also.
There is a problem with the bit rate switch.
Can you provide software that is working and the bit rate switch is enabled?
I need to verify if is that a software or hardware issue.
With the bit rate switch enable I can only receive.
But I cannot send any frames.
Hi Afifi,
I am sorry for the typo. The propagation delay should be 20U rather than 23U.
/* Data phase Baudrate */
{
500U, /* in KB */
23U,
9U,
9U,
1U,
39U, /* Sum of all timing parameters */
4U, /* Controller BRP value for Baud */
180U,
(boolean)TRUE
}
Hello,
Have you tried the new parameters?
/* Data phase Baudrate */
{
500U, /* in KB */
23U,
9U,
9U,
1U,
39U, /* Sum of all timing parameters */
4U, /* Controller BRP value for Baud */
14U,
(boolean)TRUE
}
Hello Wang,
Not yet I will test it today and update you.
Could you please write the updated parameters again without the bold font because it is a bit confusing and i don't know which one should i use?
sure.
Please those values:
/* Baud Rate Structure for all configsets */
static Can_BaudConfigType CanConfigSet_CanController_0_CanControllerBaudrateConfig_0 =
{
100U, /* in KB */
20U, //propogation
9U, //seg1
9U, //seg2
1U, //sync
39U, /* Sum of all timing parameters */
20U, /* Controller BRP value for Baud */
/* Data phase Baudrate */
{
500U, /* in KB */
20U,
9U,
9U,
1U,
39U, /* Sum of all timing parameters */
4U, /* Controller BRP value for Baud */
14U,
(boolean)TRUE
}
};
Hello Wang,
The issue is still there.
The bit rate switch is not working.
Here the communication is working when BRS is disabled(The ECU is able to receive and transmit frames)
Here the communication is now working when BRS is enabled (The ECU is able to receive but cannot transmit with BRS on )
I used your configuration and the older one provided here: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1248392/am2634-tmdscncd263
Yours,
I am sorry for that. I will check if the values of TSEG1/TSEG2 exceed the range defined in the configuration register, then run a test later today.
Kindly could you please run the test on 500/2000 instead of 100/500?
This would be better and will help more in integration.
Yours,
Abdelrhman Afifi
Hi Afifi,
Can you please try this settings:
static Can_BaudConfigType CanConfigSet_CanController_0_CanControllerBaudrateConfig_0 =
{
500U, /* in Kbps */
20U,
14U,
5U,
1U,
40U,
4U, /*BRP*/
/* Data phase Baudrate */
{
2000U, /* in Kbps */
5U, /* Prop Segement value */
3U, /* Phase Segment 1 */
1U, /* Phase Segment 2 */
1U, /* Sync jump width */
10U, /* Sum of all timing parameters */
4U, /* BRP */
14U,
(boolean)TRUE, /* Specifies if the bit rate switching shall be used */
}
};
I just noticed that my CAN analyzer was lent to another engineer in another site. I am not able to perform CAN test at this moment.
Hello Wang,
Thanks for your help.
It is working now.
Could you provide the document stating this info:
The baudrate = CAN_CLK (80MHz) / (BRP)(1+TSEG1+TSEG2)
Synchronization Segment which is always 1
I could not find it in any of the MCAL documents. Also the configuration parameters, Is there any document stating how to choose the values?
Yours,
Hi,
Nice to know the parameters work.
The CAN bit time is made of 4 non-overlapping segments: Synchronization Segment, Propagation Time Segment, Phase Buffer Segment 1, and Phase Buffer Segment 2. In the formula I gave you, TSEG1 = propagation time + phase segment 1
tq (1 time quantum) = BRP / CAN Clock
Nominal CAN bit time = (Sync_seg + Prop_seg + Seg1 + Seg2) * tq
Baudrate = 1/(nominal CAN bit time)
The sync_seg is the 1st segment in the bit timing and is used to synchronize the nodes on the CAN bus. This segment is fixed at 1TQ. Please check the MCAN specification.