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.

CCS/TMS320F28377D: Need help to generate PWM signals

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Dear,

I have herewith attached the code for generating pwm signal on ePWM2 and ePWM3 .... I wanted to use Digital Power Library and generate the signals from CLA. 

I have already succeeded this with C28x core and generated PWM signals on the same pins... 

Also, I ran the CLA_sqrt example to learn the CLA debugging process without any issues. And then deployed the DP Library to achieve pwm generation using CLA C Compiler. 

Though my code seems to be running, till now I cannot obtain the wave forms in my oscilloscope. 

I'm using CCS version 6.1.1.00022

Any help in this regard would be highly appreciated!

ePWM2&3_CLA.zip

  • Have you been able to generate the signals with the C28x first?

    sal
  • Hi Sal,

    Yes, I was able to do that. Also, after my last post, I added a LED blink loop soon after invoking the CLA function inside the main(). Then, I was able to observe the PWM on oscilloscope. But, the functions I had inside the CLA doesn't seem to take effect. As you may observe the code,

    PWM_PSFB_CNF(); function call in the "main()" of "main.c" configures the period and generates the PWM pulses...
    Later the PWMDRV_PSFB_F_C(); function call updates the phase difference and the dead bands...

    When I ran the new code, the phase and dead band did not got updated... which means my CLA task did not take effect.

    But, I can see when I insert some math functions inside the CLA task they run just fine.

    Is there something to be done when accessing ePWM / ADC registers from CLA??

    Also, could you clarify why without a endless loop at the end of the code I wasn't able to generate PWM? (I can intuitively understand that this has something to do with the system clock frequency that cycles faster than ePWM period and reset it before the next cycle starts... but is that the case?)

    Thanks & regards,
    Shyam
  • You will need an endless loop so that your interrupts and tasks will continue to take effect, or else the program will complete and the code will abort.

    You may need an MEALLOW before accessing the peripheral registers. Please try this. Also, please see other CLA examples in C2000Ware.

    sal