can Baundrate Problem

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User16898
Level 4
Level 4
Hi,

I have can communication between Aurix TC22x and PEAKCAN dongle, the problem is with baudrate settings.
On Aurix baudrate is set as 125000kbit/s
On PEAKCAN baudrate must be set 250000kbit/s, 125000kbit/s not works

Datasheet says, that there is a baundrate prescaler in can clock module, does it change somehow baudrate i place in code ?
0 Likes
8 Replies
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
Change the baudrate in your code to the needed CAN speed. 250000 bit/s are no problem for the device. How your software calculate the baudrate?
0 Likes
User16898
Level 4
Level 4
Hi, thanks for quick response,
It turned out that aurix is always doubling the set up in code baud rate.
If i set 125,250,500 kbit/s in code I have respectively 250,500,1000 kbit/s(checked in Peakcan and oscilloscope).
what can be wrongly configured in aurix multican ?
0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
Which code you are using? How you configure?
0 Likes
User16898
Level 4
Level 4
configuration code is basing on ILLD example code:
void initialize_multican(void) {
// create configuration
IfxMultican_Can_Config canConfig;;
IfxMultican_Can_initModuleConfig(&canConfig, &MODULE_CAN);
// initialize module
// IfxMultican_Can can; // defined globally
IfxMultican_Can_initModule(&can, &canConfig);

// create CAN node config
IfxMultican_Can_NodeConfig canNodeConfig;
IfxMultican_Can_Node_initConfig(&canNodeConfig, &can);

canNodeConfig.baudrate = 125000;

// Source Node
// IfxMultican_Can_Node canSrcNode; // defined globally
canNodeConfig.nodeId = IfxMultican_NodeId_0;
canNodeConfig.rxPin = &IfxMultican_RXD0A_P02_1_IN;
canNodeConfig.rxPinMode = IfxPort_InputMode_pullUp;
canNodeConfig.txPin = &IfxMultican_TXD0_P02_0_OUT;
canNodeConfig.txPinMode = IfxPort_OutputMode_pushPull;

// initialize the node
IfxMultican_Can_Node_init(&canNode, &canNodeConfig);

}


I do not change CAN configuration further in code
0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
The function IfxMultican_Can_Node_init calculate the needed settings for the needed baudrate. If you have later then 2x your baudrate then maybe the CCUCON1.CANDIV is changed after Can_Node_init. You use the latest iLLD?
0 Likes
User16898
Level 4
Level 4
what settings influence on CCUCON1.CANDIV ?

I 'm not common with ILLD libraries releases, but version used by me is 1.0.0.11.0
0 Likes
MoD
Employee
Employee
50 likes received 500 replies posted 100 solutions authored
This version is very old. I don't know if there was a problem on this version. Download the latest iLLDs from myicp (V1.0.1.9.0), maybe this solve the problem.
0 Likes
User16898
Level 4
Level 4
Problem solved, it was a bug in iLLD library.
I updated it and problem i gone.
0 Likes