Hi,
I am using EPWM module in Immediate mode to update duty in to CMPA register at the peak of the carrier(TBCNTR Zero or TBCNTR Period).Duty calculations are happening in a timer-0 Isr(50e-6 sec),which is a high priority Isr.I tested in two cases.
Case-1:Duty values are updating in CMPA register which is executing in the EPWM isr. I am using DC values as duty to check the immediate mode functionality.I changed the duty like 0.1 to 0.9 at peak of triangle.However,Pulse width is not changing as per duty change instant.Some times half carrier or one carrier delay is coming to change the pulse as per new duty
case-2: Duty values are updating in to CMPA register ahead of 150e-6 sec Triangle peak occurance.Duty also updating in timer-0 isr(not in EPWM isr).In this case also pulse width is not changing at the same instant of duty update.Some times half carrier or one carrier delay is coming to change the pulse as per new duty.But shadow mode is working fine in this case.
Immediate Configuration:
1. EPwm1Regs.TBCTL.bit.PRDLD = 1; //1-Immediate Load
2.EPwm1Regs.CMPCTL.bit.SHDWAMODE = 1; //1-Immediate mode.
3. EPwm1Regs.AQCTL.bit.SHDWAQAMODE = 0; //0: Immediate mode
4.EPwm1Regs.DBCTL.bit.SHDWDBFEDMODE =0; //0: Immediate mode.
5.EPwm1Regs.DBCTL.bit.SHDWDBREDMODE =0; //0: Immediate mode.
will you suggest me to solve this issue?