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.

Independent PWM channels?

Other Parts Discussed in Thread: LAUNCHXL-F28027, CONTROLSUITE

Hi, I'm new to TI microcontrollers, now trying to figure out things on LAUNCHXL-F28027 launchpad. For my aplication I need 7 independent PWM channels, all same frequency but duty cycle may be different (controling lights dimmers). Tried diferent example codes, but all i get that all A or all B channels  gets that same duty cycle if period is equal.  ePWM aplication note says that it is possible to controll all channels independently, but can't figure out how... maybe someone can help?

  • Please refer to F28027 ePWM reference guide (SPRUGE9E), you can disable deadband by setting DBCTL, pwm output action by setting AQCTLA and AQCTLB, use CMPA and CMPB to set duty for PWMA and PWMB channels. And you can find such pwm examples in TI C2000 ControlSuite which can be downloaded from TI website.
  • user4884894 said:
    all i get that all A or all B channels  gets that same duty cycle if period is equal

    so you are already half way, congrats :)

    Have you tried something like this

    EPwm8Regs.CMPA.bit.CMPA = X; 
    EPwm8Regs.CMPB.bit.CMPB = Y;

    EPwm1Regs.AQCTLA.bit.CAU = AQ_SET; // Set PWM1A on event A, up count
    EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR; // Clear PWM1A on event A, down count

    EPwm1Regs.AQCTLB.bit.CBU = AQ_SET; // Set PWM1B on event B, up count
    EPwm1Regs.AQCTLB.bit.CBD = AQ_CLEAR; // Clear PWM1B on event B, down count

    this way you can generate different pwm on A and B channel.

  • And it looks like the Launchpad brings out PWMs to board I/O's: GPIO0 - GPIO6 can be used as PWMs. Have fun!
  • Thank you for your support and time. Looks like if found suitable example, but now trying to figure out some errors, because example does not compile.

    http://i63.tinypic.com/2qu52dc.png

  • I hope you're importing projects from this directory:
    C:\ti\controlSUITE\device_support\f2802x\v230\f2802x_examples_structs
  • Gautam Iyer said:
    I hope you're importing projects from this directory:
    C:\ti\controlSUITE\device_support\f2802x\v230\f2802x_examples_structs

    Oh there was the problem, because i found examples in different directory, and not all examples copiled:

    C:\ti\controlSUITE\development_kits\C2000_LaunchPad\f2802x_examples

    Now all PWM's rolling as i want, thank you guys, you helped me a lot ;)