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.

TMS320F280049C: Wrong values provided by CLAasin() function

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Good afternoon,

in our project we are using the TMS320F280049C microcontroller with C2000 Ware 5_04_0_0 and the CLAmath library. 

At a certain point of the code (implemented in the .cla file), we are calculating the inverse sine of a float variable by using the CLAasin() function but, during debugging, we noticed that if the float number get close to values equal to 1, the function does not return values equal to PI/2 (1.570796...). The values we get are lower.

Just for verification, we tried also to provide a constant float equal to 1 as a argument of the CLAasin() function, but still we get lower values than PI/2 (1.570796...). Same results if we  use the CLAasin_inline() function.

Can you please help us on this topic?

Thank you in advance,

Marco R. De Cesero

  • Hi Marco,

    Can you provide some examples of input values you are using and the values returned by the functions vs. what you are expecting to have returned?

    Best Regards,

    Delaney

  • Hello Mrs Woodward,

    as my colleague Marco specified in our project we are using the TMS320F280049C microcontroller with C2000 Ware 5_04_0_0 and the CLAmath library. 

    We want to use those functions in the CLA.

    We are using the functions CLAsin  and CLAasin, but the expected return value are incorrect.

    To show you the behaviour we obtain i created those three test variables (test_variable_SIN, test_variable_ASIN, pi_div_two_test) which stores the results of the functions in their limit value conditions:

    where CLAMATH_PI_DIV_TWO is defined in the Clamath.h library

    and here the results

    From the resuts, you can see that test_variable_ASIN should be equal to CLAMATH_PI_DIV_TWO. But it is smaller.

    Can your team please suggest to us how to solve this ?

    We need to use the full range of the CLAasin function.

    Thanks in advance for the support !

    Best Regards,

    Valentina Zito

  • Hi Valentina,

    Thank you for sharing this information. I will look into this and get back to you with a response next week. 

    Best Regards,

    Delaney

  • Hi Valentina,

    I apologize for my very delayed response.

    It looks like the accuracy is slightly off. Have you tried running the cla_asin example for F28004x from C2000ware and comparing the accuracy?

    One follow-up question, you are using the CLA Math tables located in the ROM memory, is that correct? For this, you would have the add --define=CLA_MATH_TABLES_IN_ROM=1 into your project properties and use the provided f28004x_cla_c_lnk.cmd file (or add the CLA_MATH_TABLES_IN_ROM sections to yours). 

    If this is not enabled, then I'm assuming you are trying to load the tables into LSRAM for access. This can cause issues if done incorrectly, so I would advise switching to using the ROM tables instead if you aren't already. 

    Best Regards,

    Delaney