Part Number:TMS570LS1114
Hi:
In the CAN communication of TMS570LS1114, I realized the communication between CAN1; but it has been unable to communicate between CAN2 and CAN3 (the configuration is same as CAN1); Do you know the reason? Is there any special attention to the communication between different CAN ports?My design scheme is shown in the picture.
SDM1/2/3 are TMS570LS1114 chips, and each chip has the same procedure;
First, I used messageBox1 of CAN1 of SDM1 to send, and messagebox2 of CAN1 of SDM2 to receive, the same address communicates normally.
then,I used messageBox1 of CAN3 of SDM1 to send, and messagebox1 of CAN2 of SDM2 to receive, the same address failed to communicate.
Thanks for help.
Susan Yang:
我会在确认后给您回复
,
Susan Yang:
Nothing special for CAN 2 and CAN3.
Do you use the correct register frame pointer for CAN2 when you call canTransmit() and cangetData(): canREG2 ?
Are CAN2 and CAN3 enabled in your canInit()?
,
dan shen:
Thanks for your help.
1.Do you use the correct register frame pointer for CAN2 when you call canTransmit() and cangetData(): canREG2 ?
I think I'm right.I will give you my procedure,please take a look at it for me.
2.Are CAN2 and CAN3 enabled in your canInit()?
Yes,of course.I enable all the can(CAN1/CAN2/CAN3) drivers.
void can_function(void) {u8gv_tmr_addr = get_sdm_addr();if (u8gv_tmr_addr == ADDR_TMR_A){canTransmit(canREG1, canMESSAGE_BOX1, (const uint8 *)&tx_data1[0]);//CAN1 sends data1 to A and B //canTransmit(canREG2, canMESSAGE_BOX1, (const uint8 *)&tx_data1[0]);//CAN2 sends data1 to C //canTransmit(canREG3, canMESSAGE_BOX1, (const uint8 *)&tx_data1[0]);//CAN3 sends data1 to BcanGetData(canREG1, canMESSAGE_BOX5, (uint8 *)&rx_data1[0]); //CAN1 receive data for BcanGetData(canREG1, canMESSAGE_BOX6, (uint8 *)&rx_data1[0]); //CAN1 receive data for C //canGetData(canREG3, canMESSAGE_BOX5, (uint8 *)&rx_data1[0]); //CAN3 receive data for BcanGetData(canREG2, canMESSAGE_BOX6, (uint8 *)&rx_data1[0]); //CAN2 receive data for C}else if (u8gv_tmr_addr == ADDR_TMR_B){canTransmit(canREG1, canMESSAGE_BOX2, (const uint8 *)&tx_data2[0]);//CAN1 sends data2 to A and CcanTransmit(canREG2, canMESSAGE_BOX2, (const uint8 *)&tx_data2[0]);//CAN2 sends data2 to AcanTransmit(canREG3, canMESSAGE_BOX2, (const uint8 *)&tx_data2[0]);//CAN3 sends data2 to CcanGetData(canREG1, canMESSAGE_BOX4, (uint8 *)&rx_data2[0]); //CAN1 receive data for AcanGetData(canREG1, canMESSAGE_BOX6, (uint8 *)&rx_data2[0]); //CAN1 receive data for C //canGetData(canREG2, canMESSAGE_BOX4, (uint8 *)&rx_data2[0]); //CAN2 receive data for A //canGetData(canREG3, canMESSAGE_BOX6, (uint8 *)&rx_data2[0]); //CAN3 receive data for C}else if (u8gv_tmr_addr == ADDR_TMR_C){canTransmit(canREG1, canMESSAGE_BOX3, (const uint8 *)&tx_data3[0]);//CAN1 sends data3 to A and BcanTransmit(canREG2, canMESSAGE_BOX3, (const uint8 *)&tx_data3[0]);//CAN2 sends data3 to BcanTransmit(canREG3, canMESSAGE_BOX3, (const uint8 *)&tx_data3[0]);//CAN3 sends data3 to AcanGetData(canREG1, canMESSAGE_BOX4, (uint8 *)&rx_data3[0]); //CAN1 receive data for AcanGetData(canREG1, canMESSAGE_BOX5, (uint8 *)&rx_data3[0]); //CAN1 receive data for BcanGetData(canREG2, canMESSAGE_BOX5, (uint8 *)&rx_data3[0]); //CAN2 receive data for BcanGetData(canREG3, canMESSAGE_BOX4, (uint8 *)&rx_data3[0]); //CAN3 receive data for A} }
,
Susan Yang:
请您跟踪/回复下面的链接
https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1036195/tms570ls1114-can-issue
,
dan shen:
Thanks for your help, I have found the reason;Due to my own negligence, I sent the standard frame, but CAN3 selects the extended frame by default in the code generator, which caused me to sent and receive inconsistent data.
,
Susan Yang:
Thanks for your feedback!