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.

C2000-F28004X-POWER-EST-CALC: f28004x

Part Number: C2000-F28004X-POWER-EST-CALC

Hi

I am running a real time application and need to update the ePWM comparator values EPwm1Regs.CMPA.bit.CMPA and EPwm1Regs.CMPB.bit.CMPB for the same value (i do it for 3 modules at a time). I was wandering if there is a configuration which allow setting of both within one statement (i.e, assigning a value to CMPA will update both CMPA and CMPB )

Thanks

  • Hi Maor.

    Are you attempting to set CMPA and CMPB to the same value? If so, CMPB is not necessary and you can use CMPA for all of your action qualifer events. If you want CMPA and CMPB to have different values but update them at the same time, this is accomplished through shadow-loading. When shadow-loading is enabled, you can write to CMPA and CMPB at different times, but their values will not take effect until some particular event, such as TBCTR=0. By default, shadow loading is enabled for CMPA and CMPB on TBCTR=0.

    Let me know if you have any further questions.

    --Luke 

  • Hi Luke

    Yes, I am attempting to write the same value for both. 

    According to your answer I understand that it is enough to write to CMPA only and CMPB will be updated accordingly. Is this correct ?

    Maor

  • Hi Maor,

    Both EPWM output A and output B have access to either CMPA or CMPB events, so you could simply use CMPA as your action qualifier event for both outputs, instead of settings CMPB equal to CMPA.