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.

C2000 PWM question

Hi,

I am new to Microcontroller. The product which I am using is C2000 Launchpad. I tried several examples on PWM, but still got a question on it.

I can understand there are three ePWM peripherals, ePWM1, ePWM2 and ePWM3. But can anyone help me understand what is the relationship between ePWM1A and ePWM1B. Why do they always appear together? 

Also, I read from some documents that "DCAEVT1 forces EPWM1A high, a blanking window is used to EPWM1B toggles on zero as a reference". Can anyone tell me what does DCAEVT1 do and what does blanking window mean, and what does this sentence mean?

Thanks in advance

  • With 3 PWM modules, you get up to 6 PWM outputs. However, ePWM1A and ePWM1B, although independent, are tied to the same clock source.

    There is a way to synchronize ePWM1, ePWM2, and ePWM3, a technique used for 3-phase motor control. (and probably other uses as well.)

    DCA refers to the digital compare input.

    That's all for now...

  • I am just getting into doing PWM as well. How can PWM1A and PWM1B be independent if they are tied to the same clock source? I am wondering because I don't know if I should invest my time into figuring out how to de-synchronize B from A so I can hold B low while A is outputting a PWM and vice versa or if I should get rid of B altogether and focus on getting two different numbered channels to achieve this. Thanks!

    EDIT: I've found the following link to be really helpful to anyone trying to do what I was doing. From just a cursory reading I do think I will have to use separate ePWMx modules.

    Link to possible solution

  • The PWMxA and PWMxB outputs are tied to the same clock source.  However, you can configure the action qualifer for each A or B channel independently.  This means each A or B channel can have its own set of rules to control when the output goes high or low.

  • Okay that's starting to point me in the right direction. Thanks a lot for the help.

    Knowing that, I'm not really sure as to the order and location of when/where I should be configuring/starting the PWMs; I'm finding there are a lot of these rules that you've mentioned. I believe that using TripZone interrupts to pull one of the PWMxA/B low at separate times is what I'm looking for, but I'm not sure how to tie everything together.

    I have a pushbutton switch that triggers an external interrupt on GPIO0, and I'm hoping to check that counter to determine which PWM A or B would be activated and which would be pulled low. But then there are the TZ inputs on GPIO12 and GPIO16. Should I externally tie the switch GPIO to the TZ GPIO? Or do I need to somehow configure the external interrupt to trigger the TZ ISR? That seems redundant to me, but I don't really know how to get to TZ ISR to trigger when I press the button. Could I even plug the switch into GPIO12 or 16? I would have to set 12/16 high first, and then make sure to re-configure the switch such that it pulls the pin low, I believe.

  • What is your goal?

    To have the push-button force the PWM output high/low and PWM square waveforms otherwise?

  • Goal is to start both A&B low. On first button press, enable A only. On second button press enable B. On third, A. Basically using the button as a toggle for (what I think) is direction control for a motor. Thanks for taking time to help me out with this.

  • Will you be using the PWM module to output PWM waveforms?  Or are you only going to output constant low/high signals.

  • Sorry. Yes, I will be outputting PWM waveforms, but only one at once.

  • Ok.  Here is what I suggest is you try.

    Configure the PWM modules for standard operation.

    During initialization, force the PWM outputs to low using a SW force.

    You can then have a separate ISR triggered by the external INT which will clear/set the force on the PWM outputs, based on the push-button input.