AnsweredAssumed Answered

MSCAN Driver not working

Question asked by Pedro Correa de Castro on May 2, 2016
Latest reply on May 26, 2016 by Pedro Correa de Castro

Hi everyone,

I have a FRDM-KEA128 and I have some troubles testing the MSCAN drive of the Processor Expert. First of all, I am not using the transceiver that comes within the board. I am testing with a MCP2551, because it is available for my final project and I have already tested it. I connected it to the pins PTC7 and PTC6 to the Tx and RX to my transceiver and of course the on board transceiver is not powered. To see the CAN messages I have a PEAK-USB CAN sniffer. After many attempts, I was not successful in seeing any messages being transmitted by the KEA128 and I keep getting the same synchronization error. The core clock is 40MHz and the bus clock is 20MHz to set the baud rate.
I would be glad to have some tips of what am I doing wrong

 

the code was extracted in the Driver's Help:

 

PE_low_level_init();

  /*** End of Processor Expert internal initialization.                    ***/

 

 

  /* Write your code here */

  /* For example: for(;;) { } */

 

 

     MyCANPtr = CAN1_Init(NULL);                                     /* Initialization of CAN1 component */

     Frame.MessageID = 0x123U;                                       /* Set Tx ID value - standard */

     Frame.FrameType = LDD_CAN_DATA_FRAME;                           /* Specyfying type of Tx frame - Data frame */

     Frame.Length = sizeof(OutData);                                 /* Set number of bytes in data frame - 4B */

     Frame.Data = OutData;                                           /* Set pointer to OutData buffer */

     DataFrameTxFlg = FALSE;                                         /* Initialization of DataFrameTxFlg */

     Error = CAN1_SendFrame(MyCANPtr 1U, &Frame);                   /* Sends the data frame over buffer 0 */

     while (!DataFrameTxFlg) { }                                      /* Wait until data frame is transmitted */

Outcomes