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.

TMS320F28379d: PWM TBPRD reg changing on the fly

Part Number: TMS320F28379D


Tool/software: Code Composer Studio

Hi,

I'm working on a basic stepper motor drive. I read all the topics on this forum (about this subject :) ). I 'm looking for a method on how to change register TBPRD of EPWM1 when... My EPWM1 is configured and synchronized with other EPWMs by ECAP with XBAR (it's working great) and driving the CLA task. EPWM1 configurations: up-down count mode, at zero PRD, generates an interrupt and starts the CLA task1. In this task, I'm going to give pulses and change EPWM frequency. My problem is how to change the frequency od PWM after for example 5 impulses.

I read that there are some shadow TBPRD registers, can I use it for that purpose? Also, I read that  I can reload the TBPRD register when EPWM is disabled, change frequency and enable, what do you think?

Could you help me with how to do it? I'm concerned about finding the best possible method.

Best Regards,

Serafin