SPRADK6 September   2024 TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Challenge of Implementing LLC Control in MCU
    1. 2.1 Frequency Changing Requires Multiple PWM Configuration update
    2. 2.2 No Fixed Timing Relationship Between Control and Switching Frequency
  6. 3Corner Cases and Real-Case Challenges
    1. 3.1 Software Workaround
    2. 3.2 CLB-Based Hardware Workaround
  7. 4Summary
  8. 5References

Software Workaround

A simple workaround can be achieved with the following method:

while(EPwm1Regs.TBCTR>(EPwm1Regs.TBPRD – PwmUpdateTime))
{
} // Wait in while if there is no enough time for PWM register update.
PWMRegsUpdate(); //Function to update PWM shadow registers. Make sure to put all register updating code here before seting global load one-shot bit
EPwm1Regs.GLDCTL2.all = 1;

Where PwmUpdateTime is a constant that represents the time cycles reserved for PWM shadow register writing.

By doing this, a time period before the PWM cycle end is reserved. If the PWM updating happens during the reserved period, the CPU will run in a while loop and not to write PWM shadow registers until the reserved time period has passed. In this way, even GLDCTL2[OSHTLD] is set by a previous ISR in the same switching cycle, no mismatched PWM register update will happen.

 Software Workaround Figure 3-2 Software Workaround