Rajan Kumar

Sample code for CAN driver of MC9S12G128

Discussion created by Rajan Kumar on Nov 25, 2011
Latest reply on Nov 28, 2011 by Daniel Lundin


Please provide the sample code for CAN driver of MC9S12G128.

I am facing problem while initiating CAN driver.

By reset its entering into Initialization mode. I am initialising all the registers and setting Ctrl register bit to enter in normal mode. But its not coming out of initialisation mode.

Please refer the following code for reference.

  CAN_Module_Ptr -> TppCAN_Register.uc_Ctl0 = 0xFE;

  while (INITAK_BIT == (CAN_Module_Ptr -> TppCAN_Register.uc_Ctl1 \
                        & INITAK_BIT) )
    /* wait for init mode to be released */

Please provide the solution as soon as possible.