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.

TMS320F28377D: Unable to access CAN 32-Bit register

Part Number: TMS320F28377D

We are working on TMS320F28377D CAN device driver implementation, as part of the CAN module configuration we try to set the "CAN_IP_MUX21" registers IntMux bits according to selected message object. Nevertheless we are unable to access beyond 16-bit of this register. 

pseudo code:

CAN_Regs->CAN_IP_MUX21  =  1 << 31;  

Expected output: 0x80000000

Actual output: 0x8000

Could you please assist us to resolve this issue? 

  • Hi Subash, 

    On the C2000 family of processors an integer is 16-bits wide.  The number '1' in the statement defaults to an integer.  The shift operation, when compiled will yield the following warning:  #64-D shift count is too large.  

    You may update it as follows: 

    unsigned long test;

        test = 1;

        test = test << 31;

        CAN_Regs->CAN_IP_MUX21  =  test; 

    Cheers!

    Krishna

  • Hi Krishna,

    I above suggestion was not working, we had same issue that we could not set the bit beyond 15th bit. Hence we have used following method and it works.

    test = (unsigned long) 1 << 31;

    *((unsigned  int * (CAN_REG))   = test;

    *((unsigned  int * (CAN_REG + 2))   = test>>16;