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.

problem to receive a CAN data

Other Parts Discussed in Thread: TMS570LS20216

Hello,

i am trying to test CAN bus in order to transmit and receive a data. I can't receive any data.

My Interrupt service routine is:

void can1LowLevelInterrupt(void)
{
uint32 messageBox = canREG1->INT >> 16U;

/* USER CODE BEGIN (38) */
/* USER CODE END */

/** - Setup IF1 for clear pending interrupt flag */
while ((((canREG1->IF1CMD & 0x0000FF00U) >> 8U) & 0x00000080U) == 0x00000080U)
{
} /* Wait */

canREG1->IF1CMD = (canREG1->IF1CMD & 0xFF00FFFFU) | (0x08U << 16U);
canREG1->IF1CMD = (canREG1->IF1CMD & 0xFFFFFF00U) | (messageBox);

while ((((canREG1->IF1CMD & 0x0000FF00U) >> 8U) & 0x00000080U) == 0x00000080U)
{
} /* Wait */

canREG1->IF1CMD = (canREG1->IF1CMD & 0xFF00FFFFU) | (0x87U << 16U);

canMessageNotification(canREG1, messageBox);

/* USER CODE BEGIN (39) */
/* USER CODE END */
}


But i think the problem is that is not set the rights value in the register IF1CMD relating to DATA A (bit 17) and DATA B(bit 16).

Can you help me please?Could you provide me a correct example of CAN communication?

This is my project  2313.my_project.zip

Many thanks