Hi, Champs,
As described in F28075 TRM, users need to follow Using Enhanced Pulse Width Modulator (ePWM) Module for 0-100% Duty Cycle Control Application Report (literature number SPRAAI1) to output 0~100% duty cycle waveform.
However, test results show difference between type 0 EPWM and type 4 EPWM on this.
Taking an example as below, CMPA is used to make the comparison, and EPWM will load its shadow to active at TBCTR=0:
- When the counter is incrementing the CMPA match will pull the PWM output high, i.e. EPwmxRegs.AQCTLA.bit.CAU = AQ_SET;
- When the counter is decrementing the CMPA match will pull the PWM signal low, i.e. EPwmxRegs.AQCTLA.bit.CAU = AQ_CLEAR;
Basically, when CMPA is a non-zero value, EPWM will output waveform with duty cycle falls into range of 0%<duty cycle<100%, and if users want to output 100% duty cycle or all high within period, CMPA will be changed to 0 from a non-zero value, while there're two scenarios on different device families.
On type 0 EPWM, like device F2808, it seems CMPA will be loaded as 0 once TBCTR=0, and then the comparison action will be ignored thus CAU event will NOT occur so output high will not work, just like documented in TRM as below:
There are some cases when the action based on the new value can be delayed by one period or the action based on the old value can take effect for an extra period.
However, on type 4 EPWM, like device F28075, it seems to be another case. CMPA will be loaded as 0 as soon as TBCTR reaches 0, and then the comparison action will take effect immediately to generate CAU event for pulling EPWM output to high.
That means, we can output full range 0~100% duty cycle with type 4 EPWM without ISR intervention, however, there're still questions need to check.
Could you please confirm if my understanding is correct or not for above yellow highlighted statement?
And could you please help to review design details on which modification had been made to guarantee this (update CMPA=0 first and compare match second at TBCTR=0)?
If it's true, then perhaps we will also need to revise the chapter 13.6.5 Waveforms for Common Configurations on TRM.
My customer is testing this and hopefully they can use this approach in their real application to save a 2us codes execution in their ISR for this purpose, however, they have no confidence as F2808 can not support this, and they don't know if it's reliable on F28075, so it's important to show them the changes we have made and convince them from design perspective.
Thanks for your support.
Best Regards,
Ricky Zhang