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.
Hello everyone!
I'm new to coding in CCS and TI MCUs in general. My aim is to generate a sine modulated PWM signal. I've been able to input a sine wave and store the ADC result. I'm facing trouble when it comes to configuring the ePWM module. Is there a way I can directly pass the ADC result value to the ePWM module through CSS? From reading the technical reference manual, I've come to understand that I could use the Action - Qualifier Sub module (AQ) to implement this, but I'm not completely sure how.
Any help is much appreciated. Thanks!
MCU - TMS320F28069
CSS Version - 6.1.0.00104
There isn't an example for exactly this for the F28069 so you're going to have to stitch together code from different source examples. Since you already have the ADC results, the only piece you're missing is writing the data into the PWM duty cycle register. To do this, I would configure the PWM with fixed frequency and just write to the CMPA and/or CMPB register. Once you have configured the PWM pattern you don't need to touch the AQ registers. For an example of PWM configuration see the "epwm_up_aq" example in controlSUITE.
You could generate an ISR from the ADC end-of-conversion, scale the result if necessary to keep it below whatever PWM period you are using, then write it into the compare register.
If you're very new to the architecture I recommend going through the online workshop for this device at:
https://training.ti.com/c2000-mcu-1-day-workshop-8-part-series
I hope this helps.
Regards,
Richard
Glad to know it helped.
You could configure the PWM in either mode. Keep in mind that the same period register setting gives half the switching frequency in up-down count mode. Put another way, for the same switching frequency, up-down count mode has half the number of clock cycles per period compared with up-count mode, so the resolution on the edges is lower. This will probably only be a concern if your switching frequency is high (a couple of hundred kHz or so).
Regards,
Richard