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.

C2000 SinCos library implementation on F28379S



Question

It looks like the SinCos library requires IQ Math implementation for correct functionality. We are working to incorporate the SinCos library into a larger project that currently uses the FPU without IQ Math. I am unclear on my options here, or the larger impact of including IQ Math into the project. I found this TI support issue: e2e.ti.com/#2240216 which presents a similar concern, however the resolution was not clear to me. 

 

I also found this info on the IQ Math library: IQmath_Library_for_C28x under FAQ stating that there is some compatibility between IQ Math and C28x+FPU. Again, the details here are not completely clear to me and I could use some guidance to make sure we don't back ourselves into a corner with our current project.

Reply:

With the sincos transducer, position measurement comprises two parts:

  • The coarse angle, derived from the number of complete sin/cos periods, and

  • The fine angle, interpolated within one period and computed using an arctangent.

    The first is an integer, the second a float.  We need the integer handling capabilities of IQmath to efficiently combine both. 

    The sincos library is compiled with the MATH_TYPE define in “IQmathLib.h” set to IQ_MATH.  This means the IQ functions are called in fixed point mode.  This does not impede the use of floating point calculations elsewhere in the program.