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.

TMS320F28335: Possible to control 8/12 independent PWM channels?

Part Number: TMS320F28335

Hello,

In our application we need to control 8 stepper motors and 4 fans (with PWM inputs). In order to avoid wasting CPU time we are trying to control these outputs with PWM. I know that the F28335 has 12 PWM outputs, and on the 2nd revision of our board I connected all such signals to GPIOs 0-11 which are the I/Os associated with the PWM channels. After further reading of the datasheet it appears that there are only 6 PWM channels, and both outputs on each channel are "tied together." I.e. you can't drive GPIO 0/1 at different frequencies since they are both connected to PWM channel 1. 

Is there anything I overlooked that would allow us to drive these motors without using CPU time? The fans are not so important as the steppers, so our minimum requirement is 8 independent PWM channels. 

Thanks for any advice!

  • Sergey,

    You are right. There are only 6 PWM channels and both outputs A/B channels are tied to a specific frequency depending upon what TBPRD was configured and PWM clock rate.

    F28335 has 6 ECAP module, if you have spare ECAP modules you can get PWM signal if you configure in APWM mode. Please refer to TMS320x2833x, 2823x Enhanced Capture [ECAP] Module Reference Guide (Rev. A) for more details.

    Regards,
    Manoj
  • Does this mean that with the PWM + ECAP I can get 12 independent channels of PWM?

    To be more specific, it is not the pulse-width that we need to modulate for the stepper motors, but the frequency.

    So we have 4 fan outputs which are fixed frequency, pulse-width modulated, and 8 motors which are fixed pulse width, frequency modulated.

    Can we accomplish this with a mixture of eCAP and ePWM modules? Can eCAP + ePWM be used simultaneously? For example: GPIO0 is EPWM1 output A, but GPIO1 can be either EPWM1 output B *or* eCAP6.

    Does this mean that I can use the EPWM module on GPIO0 and simultaneously use the ECAP module on GPIO1? Are they completely independent or tied together in some way? I.e. do I need to care about "grouping" the outputs in any particular way or are they interchangeable?

    Your help is much appreciated.
  • Sergey,

    EPWM and ECAP modules are independent of each other. Your only limitation might be to check whether you have enough pin mux options.

    For example, GPIO1 can be configured as EPWM1B, ECAP6, MFSRB (or) GPIO1. If you configure GPIO1 as EPWM1B. You have to use ECAP6 on GPIO49. Now, if you don't have alternate GPIO mux option for ECAP6 you have to choose between ECAP6 (or) EPWM1B.

    For PWM, EPWMxA and EPWMxB share the same TBPRB(which determines the frequency). So, EPWMxA and EPWMxB will always have same frequency at a given point. They can't be independent of each other frequency wise.

    For ECAP, each ECAP module can be configured to different frequency.

    Regards,
    Manoj
  • I see. So then I would be able to do something like this...

    GPIO0 = EPWM1A
    GPIO1 = ECAP6
    GPIO2 = EPWM2A
    GPIO3 = ECAP5
    GPIO4 = EPWM3A
    GPIO5 = ECAP1
    GPIO6 = EPWM4A
    GPIO7 = ECAP2
    GPIO8 = EPWM5A
    GPIO9 = ECAP3
    GPIO10 = EPWM6A
    GPIO11 = ECAP4

    ...and have each pin be driven at a frequency independent of the others? In other words, I can still use GPIO1 for ECAP6 even though I'm using GPIO0 for EPWM1A. Is that correct?
  • Yes, you can do that.

    Regards,
    Manoj