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.
Dear team:
One of my customers has questions about the PWM interrupt in the routine “HVPSFB_PCMC”. The details are as follows:
He drew the PWM sequence diagram according to the routine, as follows:
Red is the approximate time of triggering PWM interrupt, and blue is 0 and PRD respectively, which is used to generate synchronous signal.
In the routine, the CMPB value of EPWM1 is used to generate the synchronization signal:
(*ePWM[n]).TBCTL.bit.SYNCOSEL = TB_CTR_CMPB;
The routine writes CMPB=0 in the rising interrupt, but the synchronizing signal has not been generated yet and entering the falling interrupt. Change CMPB to prd. Doesn't this mean that the synchronizing signal has not been generated?
If the program doesn't need the synchronization signal, then just set it to not generate the synchronization signal. Why do you need to change the value of CMPB back and forth?
Best regards
Green,
I believe this is done because the CMPB event is being used to start an a ADC trigger or other synchronous event which needs to occur at a specific time twice during the PWM's period.
I do not think this has to do with generating a PWM to PWM sync pulse.
Regards,
Cody
Cody
We looked at the codes carefully, and did not find using CMPB to start an a ADC trigger. What do you mean by other synchronization signals?
Regards
Hello,
it looks like the interrupts are being used to modify the action qualifier. I am not very familiar with this code, but this is likely because this device does not have the ability to have different action qualifier actions based on the counter direction. There maybe some effect on the dead-band, but that is slightly unclear to me.
I would like to note that on newer C2000 devices with type-4 PWMs these workarounds are not needed. T1 and T2 events eliminate the need for this. Please look at TMS320F280049C and TMS320f280025C.
We also have solutions examples which go along with these devices: https://www.ti.com/microcontrollers-mcus-processors/microcontrollers/c2000-real-time-control-mcus/applications/solar-digital-power.html#power-topologies
Regards,
Cody