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.

CCS/TMS320F28379D: C2000Ware Driverlib 1.0.3.0 CAN Not sending data

Part Number: TMS320F28379D


Tool/software: Code Composer Studio

Hi,

I am trying to get the Driverlib CAN example working, but with no success. I've tried the loopback.c and the loopback_interrupts.c examples and they are working fine. Now I am trying the external_transmit.c but there is no data being sent out.

I've opened the external_transmit.c example, changed the for loop to keep sending messages to this:

for(i = 0; i < TXCOUNT; i++)
    {
        //
        // Check the error flag to see if errors occurred
        //
//        if(errorFlag)
//        {
//            asm("   ESTOP0");
//        }

        //
        // Verify that the number of transmitted messages equal the number of
        // messages received before sending a new message
        //
//        if(txMsgCount == rxMsgCount)
//        {
            CAN_sendMessage(CANA_BASE, TX_MSG_OBJ_ID, MSG_DATA_LENGTH,
                            txMsgData);
            txMsgCount++;
//        }
//        else
//        {
//            errorFlag = 1;
//        }

        //
        // Delay 0.25 second before continuing
        //
        DEVICE_DELAY_US(250000);

        //
        // Increment the value in the transmitted message data.
        //
        txMsgData[0] += 0x01;
        txMsgData[1] += 0x01;
        txMsgData[2] += 0x01;
        txMsgData[3] += 0x01;
        
        //
        // Reset data if exceeds a byte
        //
        if(txMsgData[0] > 0xFF)
        {
            txMsgData[0] = 0;
        }
        if(txMsgData[1] > 0xFF)
        {
            txMsgData[1] = 0;
        }
        if(txMsgData[2] > 0xFF)
        {
            txMsgData[2] = 0;
        }
        if(txMsgData[3] > 0xFF)
        {
            txMsgData[3] = 0;
        }        
    }

 rebuilt it and uploaded it to my F28379D LaunchPad. I've connected an oscilloscope to the TX pin and I can see that upon the first message being sent, the line goes from LOW to HIGH (3.3V) and stays HIGH.

I've added the "txMsgCount" and "rxMsgCount" variables to Expression watch. The "txMsgCount" keeps incrementing but the TX line never toggles.

Any advice would be greatly appreciated.

EDIT: I found that if I enable the Test mode in External Loopback mode via 

CAN_enableTestMode(CANA_BASE,CAN_TEST_EXL);

Then the TX line does toggle. If i take this line out, the TX lines stops toggling.