Hi all,
To create a specific PWM pattern, I need to change ePWM ACTLA and ACTLB settings frequently. However, I noticed that change in the ePWM settings happens with a sample delay. This causes my code does not work properly. This is part of my code:
if (sector_rec==0)
{ EPwm1Regs.AQCTLA.all = 2;
EPwm1Regs.AQCTLB.all = 289;
EPwm2Regs.AQCTLA.all = 1;
EPwm2Regs.AQCTLB.all = 289;
EPwm3Regs.AQCTLA.all = 1;
EPwm3Regs.AQCTLB.all = 289;
}
else
{
EPwm1Regs.AQCTLA.all = 289;
EPwm1Regs.AQCTLB.all = 1;
EPwm2Regs.AQCTLA.all = 289;
EPwm2Regs.AQCTLB.all = 1;
EPwm3Regs.AQCTLA.all = 289;
EPwm3Regs.AQCTLB.all = 2;
}
In this code, variable "sector_rec" changes after a while. I need to find a way to change AQCTLA(B) setting immediately. I appreciate any help.
Thank you in advance,
-Amir
