Now i know the Cortex M0 does not have a floating point unit. Does this mean that we cannot do floating point calculations in our application? or is there a library that will simulate floating point operations.
Now i know the Cortex M0 does not have a floating point unit. Does this mean that we cannot do floating point calculations in our application? or is there a library that will simulate floating point operations.
Hi Kino,
Both Keil and gcc-arm supports floating point operations in software without floating point hardware. For gcc see http://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html, -mfloat-abi option. In Keil no compiler options has to be set as far as I know.
Your code does not have to consider if the floating point calculations are done in software or hardware. Example:
float a,b,c;
a = 3.14;
b = 2.73;
c = a * b;
Note that due to the lack of a FPU, floating point operations are very slow compared to integer operations.