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.

Delfino F28377 PWM register write in CLA

Hi,

I am using Delfino F28377. I am not able to write on PWM register in the CLA task, But i am able to read the PWM register.

I am trying to write EPwm1Regs.CMPA.half.CMPA.

Is there any setting I need to do for writing in PWM register?... I have checked the below thread, but I have already have the cla_defines included in my header file.

http://e2e.ti.com/support/microcontrollers/c2000/f/171/t/327630.aspx

Thanks & Regards,

Rathinavel

  • Hi Rathinavel,

    Are you using EALLOW while writing? Try this:

    EALLOW;
    EPwm1Regs.CMPA.half.CMPA = PWM1_DUTY_CYCLE;
    EDIS;

    Regards,

    Gautam

  • Hi Gautam,

    I have not used, as those registers are not part of protected register and I am able to write that registers without (ELLOW & EDIS) outside CLA.

    But now I tried 

    __asm(" EALLOW");
    EPwm1Regs.CMPA.half.CMPA = 1000;
    __asm(" EDIS");

    and also

    __asm(" MEALLOW");
    EPwm1Regs.CMPA.half.CMPA = 1000;
    __asm(" MEDIS");

    both code  not working.

    Presently I am updating my PWM duty cycle using the interrupt generated in CPU at the END of CLA tasks. But I feel its better if I am able to update PWM inside CLA, also that facility will help me to find the execution time of CLA code as GPIO is not accessible inside CLA.

    Thanks & Regards,

    Rathinavel

  • Hi,

    I have mentioned one wrong information.

    Actually I am able to read and write QEP register but        EPWM register is not able to read as well as write inside CLA

    Thanks & Regards,

    Rathinavel

  • 1. Make sure the way CLA code includes the PWM header file is correct

    the CLA code should see the following order of includes..

    #include "F28X7x_Cla_defines.h"
    #include "F28X7X_Cla_typedefs.h"

    ...

    #include "F28X7x_EPwm.h"

    ...

    2. Are you using DMA for PWM by any chance? Also check that the default setting of connection to CLA is enabled, (i doubt this to be the issue as you are able to read and write to QEP, but good to check)

    CpuSysRegs.SECMSEL.bit.VBUS32_1=0;  //

    3.Is this on CPU1 and CLA1? check the configuration of to make sure it is 0 is it is CPU1 - CLA1

    DevCfgRegs.CPUSEL0.all 

    4. Which example have you modified to check the PWM access?

  • Hi Manish, 

    Thank you so much.

    I missed  #include "F28X7X_Cla_typedefs.h" . I forget to notice that it is not available in #include "F28X7x_Cla_defines.h" itself.

    Now it is working fine.

    I modified the example cla_atan_cpu01 and epwm_updown_aq_cpu01 to implement PWM in CLA.

    Regards,

    Rathinavel