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.

ePWM on f28335 delfino problem

Other Parts Discussed in Thread: CONTROLSUITE

I am using F28335 Delfino to generate ePWm outputs. I want 4 same PWM output signals. I have configured same parameters in simulink ePWM window. But when i am checking signals on CRO ePWM2A is delayed compared to ePWM1A. I want them exactly same. How to do that?

  • Moving it to C2K forum
  • Ashish,
    It's pretty straightforward to create PWM channels with the same output patterns - you can just copy the register settings from one module to the next. There are some code examples in controlSUITE which will help you with that. For example, see the project at:
    C:\ti\controlSUITE\device_support\f2833x\v133\DSP2833x_examples_ccsv4\epwm_up_aq
    You might see a delay between channels either because the PWM registers have been configured to impart a phase shift, or because the PWM timers were started at different times.
    It sounds like you're using Simulink to automatically generate the code. For support with Simulink issues you'll need to contact The Mathworks or file a post on their support forum.
    Regards,
    Richard
  • I posted this question on mathworks forum also. But still reply has not come. I checked code generated by simulink. It is setting all parameters same of both ePWM1 and ePWM2. Why is delay between those two signals? Is it because only one PWM module can start at a time?

  • Ashish,

    Yes, that's correct.  

    If the Simulink generated code is not configuring any phase shift, the reason for the delay is because the PWM timers are being started at different times.  The way around this is to force zero phase shift using by enabling time-base synchronization in each PWM module and configuring the offset to zero.  You can read about the hardware side of it in chapter 2.2.3.2 of the PWM User's Guide - TI literature reference SPRUG04A.

    There should be a feature in the Simulink blockset to do this.  I don't have those tools, but please check the configuration settings for the PWM blocks in your model for options to enable and configure phase offset. 

    Regards,

    Richard

  • thanks richard for reply. yes, there is setting for synchronization action in simulink configuration block. By default it is disabled. As you said, i made it enable and give phase offset as 0 to both PWM modules. But, still same problem exists. Do i need to give different phase offset in different PWM modules?

  • Ashish,

    You should have PWM module 1 configured as the master, and PWM2 as the slave with zero phase offset.  Both timers should have the same frequency and period, so the TBCTL and TBPRD register values should be the same.  Can you double-check those settings please?

    Also, there should be an option in the PWM1 module block phase to select which event to generate the SYNC pulse on.  Please check that you have selected the CTR=zero match for that.

    With those settings I think the time-bases must lock.  Please let me know what you find.  Thanks.

    Regards,

    Richard

  • Richard, I checked as you said. There is functionality called synchronous output(SYNCO). It was selected as "Pass through" by default. I changed it to CTR=Zero as you said. But, there is not any settings to select Master and Slave as you said in simulink block. Also in datasheet i tried to find that. But i havn't got that.
    P.S. still same problem exists.

  • Ashish,

    As long as PWM1 has SYNCO set to CTR=Zero and PWM2 has SYNCIN enabled and phase shift set to zero you should get what you want. There's a missing detail somewhere.

    Do you have visibility of the generated PWM1 & PWM2 register settings? If so, could you post them here please?

    By the way, if you have controlSUITE installed on your machine there's a simple example project which will configure the device to generate six phase synchronized PWMs. If controlSUITE is in the default location you can find the project at:
    C:\ti\controlSUITE\device_support\f2833x\v133\DSP2833x_examples_ccsv4\epwm_timer_interrupts

    Regards,

    Richard
  • Richard,
    Thank you very much. As you said, i did. It is working as expected now. thanks.

  • Richard,
    Can you please help me with following query.
    e2e.ti.com/.../442125
  • Richard,
    can you help me with following query.
    e2e.ti.com/.../443234