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.

TMS320F280049: Can Transmit Data Not Match TX Pin Data

Part Number: TMS320F280049
Other Parts Discussed in Thread: LAUNCHXL-F280049C

Tool/software:

This is my code and when i send can message, i cannot see the message from pcanview. Pcanview give me an error BUSHEAVY. 

If i analyze tx pin in oscilloscope i get 0x1556AAAB.... 

When i send message from pcan to mcu, the program did not RX interrupt. If i analyze rx pin i get the correct message but MCU didnt get it.

CCS 12.7.1, SysConf 1.20, empty_driverlib_project, F28004x_64PM

I checked the document Programming Examples and Debug Strategies for the DCAN Module.

The code is correctly running on eval board launchxl-f280049c. The only difference i made is changing the pin configs.

#include "driverlib.h"
#include "device.h"
#include "board.h"
#include "c2000ware_libraries.h"

#define KL_CAN_TX_OBJ_ID 1
#define KL_CAN_RX_OBJ_ID 2
#define KL_CAN_TX_MSG_ID 0x15555556
#define KL_CAN_RX_MSG_ID 0x15555555

uint16_t txMsgData[8] = {0x12, 0x34, 0x56, 0x78, 0x22, 0x74, 0x56, 0x98};
uint16_t rxMsgData[8];

__interrupt void canaISR(void);
void kl_CANInit(void);

void main(void)
{
Device_init();
Device_initGPIO();
Interrupt_initModule();
Interrupt_initVectorTable();
Board_init();
C2000Ware_libraries_init();

EALLOW;
kl_CANInit();
CAN_disableRetry(CANA_BASE);
EDIS;

EINT;
ERTM;

while(1)
{
DEVICE_DELAY_US(1000000);
CAN_sendMessage(CANA_BASE, KL_CAN_TX_OBJ_ID, 8, txMsgData);
}
}

__interrupt void canaISR(void)
{
uint32_t status;

status = CAN_getInterruptCause(CANA_BASE);
if(status == CAN_INT_INT0ID_STATUS)
{
status = CAN_getStatus(CANA_BASE);
}
else if(status == KL_CAN_TX_OBJ_ID)
{
CAN_clearInterruptStatus(CANA_BASE, KL_CAN_TX_OBJ_ID);
}
else if(status == KL_CAN_RX_OBJ_ID)
{
CAN_readMessage(CANA_BASE, KL_CAN_RX_OBJ_ID, rxMsgData);
CAN_clearInterruptStatus(CANA_BASE, KL_CAN_RX_OBJ_ID);
}
else
{

}

CAN_clearGlobalInterruptStatus(CANA_BASE, CAN_GLOBAL_INT_CANINT0);
Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
}

void kl_CANInit(void)
{
GPIO_setPinConfig(GPIO_5_CANA_RX);
GPIO_setPinConfig(GPIO_4_CANA_TX);

CAN_initModule(CANA_BASE);

// 100MHz Clock, Can Speed 250Kb/s, T1:10, T2:5, SJW:3
CAN_setBitTiming(CANA_BASE, 24, 0, 9, 4, 3);

CAN_enableInterrupt(CANA_BASE, CAN_INT_IE0 | CAN_INT_ERROR | CAN_INT_STATUS);
Interrupt_register(INT_CANA0, &canaISR);
Interrupt_enable(INT_CANA0);
CAN_enableGlobalInterrupt(CANA_BASE, CAN_GLOBAL_INT_CANINT0);

CAN_setupMessageObject(CANA_BASE, KL_CAN_TX_OBJ_ID, KL_CAN_TX_MSG_ID,
CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_TX, 0,
CAN_MSG_OBJ_TX_INT_ENABLE, 8);

CAN_setupMessageObject(CANA_BASE, KL_CAN_RX_OBJ_ID, KL_CAN_RX_MSG_ID,
CAN_MSG_FRAME_EXT, CAN_MSG_OBJ_TYPE_RX, 0,
CAN_MSG_OBJ_RX_INT_ENABLE, 8);

CAN_startModule(CANA_BASE);
}