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.

TMS320F28388D: Problem with writing to MCAN Registers

Part Number: TMS320F28388D

Tool/software:

Hi Experts,

I have an issue regarding the MCAN peripheral, when it comes to writing values onto the registers.

I configured CPU1 sysclk, not the sysclock from connectivity manager (used EALLOW) and followed the steps from the TRM to initialize the MCAN from TRM  as below.

When I open debugger in Register view I see that the init bit is still set although I clear it in my code, additionally I try to write a value to NBTP Register, but it looks like I see the value from the TRM Register example:

My own set values got completely ignored, the CCE bit is also not set as I see from debugger.

  • Hi Caspar,

    In F28388D, the MCAN peripheral can be controlled by C28x CPU1/CPU2 or the CM core.  If the module ownership is not properly configured, then writing to the MCAN registers from a core that does not have access will not have any effect.  Check to make sure you are running API SysCtl_allocateSharedPeripheral(SYSCTL_PALLOCATE_MCAN_A, allocate);  allocate will either be 0 or 1 ;  0 allows MCAN module access to C28x CPU1/CPU2,  1 allows MCAN module access to CM core.

    Regards,

    Joseph 

  • Hi Joseph,

    I already configured PALLOCATE0 register on MCAN bit to 0 in my example, but it still doesn't let me write on MCAN registers, I used CPU1 for MCAN.

    I think issue maybe with the Wakeup enable bit, when I wrote the AUTOWAKE bit to 1 via debugger I could write onto MCAN register with debugger. I didn't really get how to use the Wakeup bit, maybe you can explain a little more in detail.

    Thanks in advance.

    Caspar

  • Hi Caspar,

    Can you check if the clock enable bit for MCAN is set?  You can monitor PCLKCR10 register.  Particularly want to check is MCAN_A (bit 4) is set.  If this bit is not set, you cannot update the MCAN registers.

    Regards,

    Joseph

  • Hi Joseph,

    I can see that the MCAN_A bit is set inside of PCLKCR10 register. Also by setting ClkCfgRegs.CLKSRCCTL2.bit.MCANABITCLKSEL = 1; I can now reset INIT bit from IDE by using registers view, but not with my code somehow.

    I have the version 12.7.1 of CCS and I don't know why, but the registers view of CCS won't show me this MCAN_A bit inside of the register

    Only when I add the register into "Expressions" window I can see the values of this register, do you know why?

    Also the "expressions" window doesn't let my reset INIT bit but the "Registers" view does, some values even differ between both these two windows. What is the best to use out of both views in case of correctness of the result?

    Regards,

    Caspar

  • Hi,

    I found the issue, I worked with the older library header where some register addresses were differing