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.

TMS320F28027: The IQ operation affects the PWM output

Part Number: TMS320F28027

Hi team,

Here're few questions from the customer may need your help:

1) The IQ code in the PWM2 interrupt is as follows:

https://e2echina.ti.com/cfs-file/__key/communityserver-discussions-components-files/56/8738.28027IQTest2.rar

iqtmp =_IQ(spwmiqvar.spwm_cnt)+_IQ(SIN_B);

spwmiqvar.sinvale =_IQsin(spwmiqvar.sina);

spwmiqvar.sinb =_IQmpy(spwmiqvar.M_FACTOR,spwmiqvar.sinvale);

spwm_value=1000+1000*_IQtoF(spwmiqvar.sinb);

How many cycles does the above code execute?

This device has a crystal configuration of 60 MHz and an instruction cycle of 16.6 ns, is this correct? 

2) There are 30 global_Q values in IQmathLib.h, are all 30 values stored in the IQmath table? 

3) Under what circumstances would it be performed faster with IQ? 

For example, three variables UINT16_t a,b; float C.

In the first case:

A=b*c;

Second case:

A=b*_IQtoF(_IQ(c));

Third case:

A=b* _IQ(c) >> global_Q;

What is the execution speed of each of the three cases? 

Could you help check this case? Thanks.

Best Regards,

Cherry