Other Parts Discussed in Thread: CONTROLSUITE
Hi there,
I am using a DSP 28377D to control a converter and I just have a question in regards to the "type" of code which is normally executed inside the pwm interrupt service routine (ISR). In my code an interrupt is triggered every time the Time Base Counter equals zero.
In my code there is a PI controller whose output is the duty ratio, which in turn is the CMP value of the PWM, determining the switch-on time.
My question is, do you usually execute the PI controller code inside the PWM ISR? and then you update the the CMP value of the PWM still inside the PWM ISR?
I just wanted to know if there is a best practice regarding where to calculate the control and update the CMP value. It is best to do this in the infinite loop (background loop) or inside the pwm ISR?
Also, if you have any reference to help understand these kind of topics, could you please share it?
Thank you so much,
Leo