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.

TMS320F28335 - Calc trigonometric functions with the FPU on board



Hi @ all,

i want to use the FPU hardware on board, to calculate some trigonometric functions (sin/cos, only singe precision/ float).

I will set the setting of CCS4, as shown in the Example_2833xFPU_hardware.

Must I use the header "math.h" to calculate trigonometric functions fast with the FPU on board, too?

Are there some examples?

 

Best regards,

Chris

 

  • Chris,

    When you setup your project make sure you pull in the rts2800_fpu32.lib runtime support library. This will have floating point routines for all the trig functions. You will need to include math.h in your project.

    I dont think there are any examples that are specific to math.h. But again this is an ANSI C library so the standard functions will be supported.

     

  • Also you have to turn on fpu support in the project properties under the "Run Time Support" Option

  • There is a fast supplemental library that can be linked in.  Helps with atan, cos, sin, sqrt, and div.  I had to use this with a fast ISR in order to get the execution time down.

     

    rts2800_fpu28_fast_supplement.lib

  • Good morning,

    thank you for reply my questions!

    First of all I have set the properties as follows:

     

    I hope thats correct?

    These are all properties i have set.

    Another point is, that the header "math.h" use variables of the type double. I think that reduce the speed of calculation!?

     

    Ok, and then i have read the Module User’s Guide (C28x_FPU_FastRTS_v10) and asking me, what is the advantage of the C28x_FPU_RTS?

    Related to the IQMath library, the calculation of sin/cos is not much faster:

    !Fast! FPU

    !IQ_MATH

     

    Why do I need a FPU, although the calculation time is similar to the fixed point?

     

    With best regards,

    Chris

  • Your link order is incorrect. You should have the supplement lib first in the sequence.

    The rts fast lib is also faster when you use floating point variables. For example, a calculation of y=sin(x) will use the float sin - lookup table in ROM instead of calling a library function to calculate the value.