1. I have ported my motor control current PI loop from F28069M C28 to CLA, somehow the PWM signals are not changed by CLA writing different values into CMPx registers.
//set compare registers
EPwm1Regs.CMPA.half.CMPA = compValue[0]; // PWM 1A - PhaseA
EPwm2Regs.CMPA.half.CMPA = compValue[1]; // PWM 2A - PhaseB
EPwm3Regs.CMPA.half.CMPA = compValue[2]; // PWM 3A - PhaseC
I noticed that there was a posting on this forum about the following setting. I tried both 0 and 1 to the CONFIG bit, there was no effect.
EALLOW;
SysCtrlRegs.EPWMCFG.bit.CONFIG = 1; //ePWM DMA/CLA Configuration Register
EDIS;
2. Another question on CPUtoCLA1 variables issue. I had a variable Bool btn1Closed declared in a C28 file,
#pragma DATA_SECTION(btn1Closed, "CpuToCla1MsgRAM")
volatile Bool btn1Closed; //button 1 status
In CLA1, I used it in a condition checking as below
if ((engageCmd == MTR_DISENGAGE) || (btn1Closed == True))
{
//shut down motor upon either disengage command or button1 closed event
DisengageMotor();
}
else
{
//link to PWM module of DSP
pwmRatio = GetSvPwm();
SetPwmCmpRegs(pwmRatio);
}
However, regardless what value of the variable btn1Closed is, the execution logic always jumps to the "else" branch.
I'm stuck at this point, please advise ASAP. Thank you very much!
-Louis
