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.

Getting Started with the C2000 ePWM Module

This video is a technical introductory overview of the basic functional operation of the C2000 ePWM module. The key purpose of this video is to help new users get started and minimize the learning curve associated with reading the Technical Reference Manual. This video is based on the type-4 ePWM module and not all features are available on previous e-PWM module types.

The Getting Started with the C2000 ePWM Module video can be found at:

https://training.ti.com/getting-started-c2000-epwm-module

  • Thanks Ken, it will be a useful link.
  • Dear Sir,
    Thanks for the video. I would like to know more about the following section of the video.

    "The period register of EPWM modules has a shadow register, which acts like a buffer to allow the register updates to be synchronized with the counter, thus avoiding corruption or spurious operation from the register being modified asynchronously by software."

    In an application I would like to use the ADC - EPMW module combination as a digital voltage to frequency converter (VFC) with a response time of 10 us. Frequency range required for the VFC is 1kHz to 50kHz. To achieve this response time I have to let the ADC to do the conversions continuously and modify the period register asynchronously without any corruption of data. Is there any workaround to avoid corruption or spurious operation of period register.

    Thanks and regards
    ttoop

  • Hi ttoop,

    The shadow registers allow you to write values to the epwm configurations that only take effect at a certain time e.g. at the start of the period.

    Can you draw what back-to-back periods look like with changing frequency? Does the decision just need to be made close to the end of the current period, or do you want to be able to change the frequency at any point in the period before the switching has occurred?
  • Dear Sir,

    Thanks for your response. Please find my following point-wise reply.

    1. The shadow registers allow you to write values to the epwm configurations that only take effect at a certain time e.g. at the start of the period.

    Reply: This will not work in my case. Because if the EPWM output frequency is 1kHz (time period = 1ms), it will take 1ms time to update to a new value.
    Our EPWM frequency will be variable from 1kHz to 50kHz with 8uS pulse width.

    2. Can you draw what back-to-back periods look like with changing frequency?

    Reply: For large load variations, like welding machine applications, there is a chance that two back-to-back period ( two adjacent period ) may differ
    by 980us when the it changes the frequency from 1kHz to 50kHz or vice-versa.

    3. Does the decision just need to be made close to the end of the current period,
    or do you want to be able to change the frequency at any point in the period before the switching has occurred?

    Reply: I want to be able to change the frequency at any point in the period before the switching has occurred.

    Thanks and regards
    Ttoop

  • Hi Ttoop,

    The cleanest way to implement variable PWM frequency is to use shadow load mode for period and other PWM registers. This ensures that the new frequency takes effect at the end of the current switching cycle.

    In your case you may just have to use immediate load mode because you do not want to wait till the end of the switching cycle to change the frequency. In your implementation you will have to take care of when and where the PWM registers get updated in time with respect to the PWM time-base counter.

    One possible way to ease this burden would be to still use shadow loading and to force a software sync whenever new frequency values are calculated. This would force the PWM counter to go to a reset value on a sync. When this reset value is set to 0/PRD it could allow new period and other PWM registers to take effect from this point on. You will still have to take care that all PWM registers do get updated before the reset value and that the counter does not reach the reset value naturally while your updates are in progress.

    I hope this helps.

    Hrishi

  • Dear Sir,

    Thanks for your reply. I will try your suggestions.

    Thanks and regards

    Ttoop