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.

TMS320F28379D: Bitrate mismatch

Part Number: TMS320F28379D


Tool/software:

Hi Ti,

I am using the TMS320F28379D with the PCANFD (CAN to USB) adapter. My problem is that I am unable to receive data correctly on both ends. On the board side, I have set the bitrate to 500 kbps, but on the PCANFD side, I can only receive data when the bitrate is set to 250 kbps. When I set the bitrate to 250 kbps, I am able to view the data, but not at 500 kbps.

I am unsure why this is happening. Does the clock matter? Does the bitrate, prescaler, or SJW (Synchronization Jump Width) play a role in this issue? I am having difficulty understanding how to set the correct configuration. I have reviewed the TI technical documentation but couldn't find a clear answer. If you could provide a clear explanation and guidance on how to fix this issue, it would be very helpful.

#include "device.h"
#include "driverlib.h"
#include <can.h>

#define TX_MSG_OBJ_ID      1
#define MSG_DATA_LENGTH    4

uint16_t data = 0;
void main(void)
{
   Device_init();
   Device_initGPIO();

//   GPIO_17_CANRXB
//   GPIO_12_CANTXB
   GPIO_setPinConfig(GPIO_17_CANRXB);
   GPIO_setPinConfig(GPIO_12_CANTXB);
   CAN_initModule(CANB_BASE);
   CAN_setBitRate(CANB_BASE, DEVICE_SYSCLK_FREQ, 500000, 16);

   CAN_setupMessageObject(CANB_BASE, TX_MSG_OBJ_ID, 0x01,
                          CAN_MSG_FRAME_STD, CAN_MSG_OBJ_TYPE_TX, 0,
                          CAN_MSG_OBJ_NO_FLAGS, MSG_DATA_LENGTH);

   CAN_startModule(CANB_BASE);

   EINT;

   while(1){

       CAN_sendMessage(CANB_BASE, TX_MSG_OBJ_ID, MSG_DATA_LENGTH, (uint16_t)data);
       while(((HWREGH(CANB_BASE + CAN_O_ES) & CAN_ES_TXOK)) ==  CAN_ES_TXOK)
       {
       }
       data++;
   }
}