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.

TMS320F280025C: CAN Message on Logic analyzer

Part Number: TMS320F280025C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

I have code for sending data via CAN, and it builds and runs successfully in Code Composer Studio. In the expression window, I can see the data. However, when I connect the designated pin on the TMS320F280025C board to a logic analyzer as shown in the diagram, no data is visible on the analyzer.

Do I need to make any changes in Code Composer Studio or check specific settings on the logic analyzer to view the data?

//
//
//
#include "device.h"
#include "driverlib.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>


#define TX_MSG_OBJ_ID      1
#define MSG_DATA_LENGTH    8


uint16_t txMsgData_1[8]={0x11,0x12,0x23,0x84,0x75,0x16,0x37,0x28};


void main(void)
{


    Device_init();

    Device_initGPIO();


    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANRXA);
    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANTXA);
    CAN_initModule(CANA_BASE);
    CAN_setBitRate(CANA_BASE, DEVICE_SYSCLK_FREQ, 500000, 16);


    CAN_setupMessageObject(CANA_BASE, TX_MSG_OBJ_ID, 0x18FB47FF,
                           CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_TX, 0,
                           CAN_MSG_OBJ_NO_FLAGS, MSG_DATA_LENGTH);

    CAN_startModule(CANA_BASE);


    EINT;

    while(1)

           {

        CAN_sendMessage(CANA_BASE, TX_MSG_OBJ_ID, MSG_DATA_LENGTH, txMsgData_1);
        while(((HWREGH(CANA_BASE + CAN_O_ES) & CAN_ES_TXOK)) ==  CAN_ES_TXOK)
            {

             }

         DEVICE_DELAY_US(1000000);
            }


}

  • Hi Sudharshan,

    The CAN protocol checks for the status of the CAN bus and the sending node cannot transmit data if CAN bus is in a certain state.  The CAN module also checks for an ACKnowledge from a receiving node.  There are periodic checks that the CAN module does based on the data in CANRX.  You can't just simply connect the CAN pins to a scope or logic analyzer.  A scope with CAN data analysis capability will work though.

    Another option if you just want to observe the CAN frame out of the CANTX pin, use external loopback mode (see the examples in C2000Ware).  Data is transmitted through CANTX and looped back and received internally in the device (so you do not have to worry about message ACK) but at the same time, data can be observed in the CANTX pin.

    Regards,

    Joseph