AnsweredAssumed Answered

TRK-KEA128 BOARD, READ A CAN MESSAGE

Question asked by Emilio Aron Moyers on Jan 20, 2016
Latest reply on Jan 21, 2016 by Kerry Zhou

HELLO I´M USING TRK-KEA128 BOARD, I'M TRYING TO READ A CAN MESSAGE BUT CAN´T SEE ANY RESULT. I DON´T KNOW IF IT IS READING OR NOT, I DON´T KNOW WHERE CAN I SEE DE DATA. I'M USING CW AND THE CODE I'M USING I DOWNLOAD IT FROM KEA Reliable, Low-power MCUs|NXP .THE CODE I´M USING IS:

 

  Clk_Init();

  MSCAN_ModuleEn();

  GPIOB_PDDR |= (1<<16);    /*! MC33901 STB, Mapped from GPIOB16 */

  GPIOB_PCOR = (1<<16);

  /*write your own code here*/

  int err_status;    //To store the return value of the driver APIs.

  uint8 data[9];

  int buffer_status[9];

  /* Configure message buffer 0 */

  Config_CAN_MB(0, 0, RXDF, 0);

  /* Wait until new data has been received in message buffer 0 */

  while (buffer_status[0] != NEWDATA)     //Wait for the Receive ISR to finish and change the buffer status, NEWDATA indicates that the buffer has receive a new data

     {           //check buffer status

         err_status = Check_CAN_MB_Status(0, 0, buffer_status);  

     } 

  err_status = Read_CAN_MB_Data(0, 0, data); //Copy the received data in msCAN channel 0 buffer 0 to data;

 

 

 

  return 0;

}

 

I CAN TRANSMIT A MESSAGE BUT I DON'T KNOW IF IT'S READING.

 

CAN SOMEBODY HELP ME??

Outcomes