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.

About math library of 28335

Hi,

I have confused about 2 math lib: CLAmath and FPUfastRTS. I've already used FPUfastRTS and it worked very well, my code run faster (many  sin, cos functions in my code). But in CLAmath lib, it is also support calculate sin and cos. So, which library is more precision and which library is faster.

Thanks.

  • But in CLAmath lib, it is also support calculate sin and cos. So, which library is more precision and which library is faster.

    This is meant for controllers with CLA. F28335 does not have a CLA so using this library makes no sense. You can check more about CLA here: http://processors.wiki.ti.com/index.php/Control_Law_Accelerator_%28C2000_CLA%29_FAQ

    F28069, F28035 and F28377D are few of the mcus having CLA.

    Regards,

    Gautam

  • Hi Phien,

    First, i want to point out that the CLAmath can only be used on the CLA and the FPUfastRTS only on the c28x. Both libraries use similar algorithms for the trig routines i.e. table lookup and either polynomial (quadratic) interpolation or taylor series expansion up to a few terms. They are fast routines but you sacrifice a bit of accuracy in the process. 

    For better accuracy you should use the math.h routines in the run time support library rts_2800.lib for the c28x. For the cla, there is no run time support library so you have to use the CLAmath library.

  • Thanks for all responses,  I got a little bit about it.

    1/ CLA is a hardware module on chip as FPU. It run parallel with chip. CLAmath only support for chip have CLA module.

    2/ FPUfastRTU is a lookup table  and only support sin, cos function.

    3/ About accuracy (example 28069) rts2800_fpu32 > FPUfastRTU = CLAmath,

    and about speed CLAmath, FPUfastRTU > rts2800_fpu32  isn't it?

    4/ CLAmath  and rts2800 in floating-point chip is more accuracy than fixed-point chip ?

    5/ CLA hardware module is not only support for calculate (CLAmath), but also optimize several modules on chip such as ADC, PWM...

    The last question is: can i copy method calculate in rts2800_fpu32 and paste it to CLA module to improve accuracy. It look a silly question ))

    Thanks.

  • Hi,

    1/ CLA is a hardware module on chip as FPU. It run parallel with chip. CLAmath only support for chip have CLA module.

    Very true

    2/ FPUfastRTU is a lookup table  and only support sin, cos function.

    Yup, here's a complete list:

    3/ About accuracy (example 28069) rts2800_fpu32 > FPUfastRTU = CLAmath,

    and about speed CLAmath, FPUfastRTU > rts2800_fpu32  isn't it?

    Accuracy not much and speed differs according to the conditions. So not always!

    4/ CLAmath  and rts2800 in floating-point chip is more accuracy than fixed-point chip ?

    Accurate and faster

    5/ CLA hardware module is not only support for calculate (CLAmath), but also optimize several modules on chip such as ADC, PWM...

    Yup.. for more detailed peripheral support list you can check out the device datasheet.


    can i copy method calculate in rts2800_fpu32 and paste it to CLA module to improve accuracy. It look a silly question ))

    No you won't be able to do so. Also you don't need to, CLA does deliver very accurate results.

    Regards,

    Gautam

  • It is very clearly. Thank you very much Gautam. Your help is totally helpful.

    Phien Nguyen

  • You're Welcome, Phien. I would like you to close this thread by verifying the answers if your queries have been answered.

    Goodluck & Regards,

    Gautam