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.

TMS570LS1114: CAN ISSUE

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.

  • 我会在确认后给您回复

  • 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()?

  • 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 B
    
    		canGetData(canREG1, canMESSAGE_BOX5, (uint8 *)&rx_data1[0]);	//CAN1 receive data for B
    		canGetData(canREG1, canMESSAGE_BOX6, (uint8 *)&rx_data1[0]);	//CAN1 receive data for C
    //		canGetData(canREG3, canMESSAGE_BOX5, (uint8 *)&rx_data1[0]);	//CAN3 receive data for B
    		canGetData(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 C
    		canTransmit(canREG2, canMESSAGE_BOX2, (const uint8 *)&tx_data2[0]);		//CAN2 sends data2 to A
    		canTransmit(canREG3, canMESSAGE_BOX2, (const uint8 *)&tx_data2[0]);		//CAN3 sends data2 to C
    
    		canGetData(canREG1, canMESSAGE_BOX4, (uint8 *)&rx_data2[0]);	//CAN1 receive data for A
    		canGetData(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 B
    		canTransmit(canREG2, canMESSAGE_BOX3, (const uint8 *)&tx_data3[0]);		//CAN2 sends data3 to B
    		canTransmit(canREG3, canMESSAGE_BOX3, (const uint8 *)&tx_data3[0]);		//CAN3 sends data3 to A
    
    		canGetData(canREG1, canMESSAGE_BOX4, (uint8 *)&rx_data3[0]);	//CAN1 receive data for A
    		canGetData(canREG1, canMESSAGE_BOX5, (uint8 *)&rx_data3[0]);	//CAN1 receive data for B
    		canGetData(canREG2, canMESSAGE_BOX5, (uint8 *)&rx_data3[0]);	//CAN2 receive data for B
    		canGetData(canREG3, canMESSAGE_BOX4, (uint8 *)&rx_data3[0]);	//CAN3 receive data for A
    
    	}
    }

  • 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.

  • Thanks for your feedback!