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.

Unsuccessful 32 bits write to TBPRDM from .cla file using Cla-C compiler

Other Parts Discussed in Thread: CONTROLSUITE

Hello,

  I'm writing to EPwmxRegs.TBPRDM.all a Uint32 and I can't see the number I wrote in the actual register once the writing instruction is executed. I'm using the Cla-C compiler and executing the following:

EPwm1Regs.TBPRDM.all = 0x02585900;

  After executing this line EPwm1Regs.TBPRDM.all in the "Expressions" window on the debug perspective is still showing the value used in the initialization of the register (at the beginning of the program), as if the write wouldn't have happened at all.

  Any suggestions?

   Thanks,

Lucas

  • Lucas,

    What device are you using?

    Can you successfully write 0x02585900 to the EPwm1Regs.TBPRDM via the Expressions window?  (if so, then perhaps your CLA is not being configured correctly)


    Thank you,
    Brett

  • Thanks for your reply Brett.

    Yes, I can write from the Expressions window.

    I'm using the 28035.

    Some interesting facts:

    The disassembly for the instruction is is

    "EPwm2Regs.TBPRDM.all = 0x02585900;"

    00009030: 78400258 MMOVIZ MR0, #0x258
    00009032: 78805900 MMOVXI MR0, #0x5900
    00009034: 74C06894 MMOV32 @0x6894, MR0

    Which is in disagreement with the address shown for EPwm2Regs.TBPRDM.all in the expressions window which is 0x686A

    Does that help?

  • Hi Lucas,

    This is probably due to the fact that int is treated differently on both cores(16 bit for C28 and 32 bit for CLA). We had created a speacial typedefs.h for the CLA "<DeviceName>_Cla_typedefs.h" and we included this in the DSP28x_Project.h header file in a SPECIFIC order that needs to be maintained. In case you arent using the standard headers make sure that you keep the order of inclusion consistent with whats in controlSUITE

    Example of DSP28x_Project.h in 28035 folder:

    #include "DSP2803x_Cla_typedefs.h"// F2806x CLA Type definitions
    #include "DSP2803x_Device.h"      // F2806x Headerfile Include File
    #include "DSP2803x_Examples.h"       // F2806x Examples Include File

  • Hi Vishal,

    You were right that was causing the issue. I didn't find that very clear from the documentation for the Cla-C compiler spru514e.

    Thanks for you help,

    Lucas