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 FPU64 in F28335?



Hi all,

I encounter some problems in my project, the float-point precision in F28335 only up to 32-bit Single-Precision. So when I try to process some data in 64-bit float-point, the result can't reach the requirement. I found there are hardware FP support in F28335, but it seems there is FPU32 only. So is there any type of C2000 series MCU can process double-precision? It can be hardware support such as FPU64 or software support such as 64-bit rts library.

Thanks.

Allen

  • Allen, 

    At the moment ther is no C2000 device with HW support for double precision floating point arithmetics. TI people could elaborate if there are any plans for the future.

    If I remember correctly some versions of the compiler did not support double precision (float and double were the same single precision). Check the compiler documentation or if you find it easier make a test case.

    Regards, Mitja

  • The new CCS versions support double precision floating point. In software. But keep in mind: "double" is just single precision, "long double" is double precision. And all math library functions use double => they are single precision.

    Best regards,
    Edwin Krasser

  • Thanks all.

    I already converted the data type to long double.  But just an assignment operation is out of precision requirement such as:

    long double tmp = 30.57542217;

    But in memory it shows 0x403E934EE0000000, equal to 30.57542228698731.

    Our project require a significant digit of at least 10, the assignment only reached 8, it's not enough. And I think this is no related to the math or rts library. So what's the reason?

  • Well, that sounds that the written constant in "C" is treated as single precision float and copied to the double precision variable later. Hence, you should add an 'L' suffix to your long number.

    long double tmp = 30.57542217L;

    Best regards and good luck
    Edwin Krasser

  • Thanks Edwin, it works when the suffix "L" added.

    But it seems there is no way to improve the precision of math and rts library? Is there double-precision math library for this device?

    The result can not reach the requirement using rts2800_FPU32.lib.

  • I do not know which and how many math functions you need with double precision. If you just need one or two functions I suggest to write it on your own (or do some internet research for the math lib function source).

    Best regards and good luck
    Edwin Krasser

  • Yes, I know it's a way to write the assembly code by ourselves. But the workload is too high to achieve because there are so many functions.

    Anyway, thanks for the help and hope TI can release the double-precision math library.

    Allen

  • I heard that one of the easiest ways to implement the function is to make a table for the function.

    But I think it is not an option for you. because you want at least 10 decimal digits without calculation error.

    We cannot make such a large table in C2000 series.

     

     

  • If you really need 10 decimal digit resolution I would seriously consider going to fixed point solution using 64 bits (long long). It gives you plenty of range and resolution is known.