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.

TMS320F280049C: Question regarding PWM compare registers

Part Number: TMS320F280049C

Hello,
I'm trying to control 8 synchronous PWM modules with 16 outputs in total.
These are separated into two dependent groups of 4 PWM modules with individual settings.
I need the output signals of each PWM module need to be complementary and not inverted.
Also, there needs to be the possibility to implement a phase shift between the two groups, with the above-mentioned restriction.
For safety reasons, i need to calculate the compare register values during operation.
This should eliminate the possibility of accidental overlapping of the complementary signals within the group and also the related complementary signals from the second group.
I'm using the counter configured as Up-Down-Counter.
The signals are generated by checking on compareA and compareB registers up and down events.
Additionally, two modules generate an interrupt, utilizing compareC register for reloading the compareA and compareB registers before the beginning of the next period.
My problem now is that implementing this is only possible, if the two compare registers are updated frequently.
This seems only be stable up to certain PWM frequencies as the speed of the update during the period seems not reliable.
Is there a possibility to utilize compareC and compareD additionally to generate ActionQualifier Events as this would eliminate the need to update the registers during PWM operation?
Alternatively is there another reliable solution for updating the registers?
  • Hello,

    Is there a possibility to utilize compareC and compareD additionally to generate ActionQualifier Events as this would eliminate the need to update the registers during PWM operation?

    No, only Compare A and Compare B can be used to generate action qualifier events. 

    Alternatively is there another reliable solution for updating the registers?

    I would suggest you look into using the global load and one-shot load feature available for EPWM modules. Essentially, you can update the compare values and set the one-shot load flag when all updates are "ready" to be moved from shadow to active registers. Once you set this flag it will update all of the compare values at the next specified event (TBCTR = zero, period, etc.). This is a useful feature when the compare values, or period, etc. are being calculated outside of the PWM ISR. 

    More information is described within the TRM or within the "Safe and Optimized PWM Updates in High-Frequency, Multi-Phase and Variable Frequency Topologies" section within "The Essential Guide to Developing with C2000 Real-Time Microcontrollers"

    Best Regards,

    Marlyn