2019-08-19 08:22 PM
Hello,
I am using STM32F103c6 ( Cortex m3) and there is no Floating point unit on this Board.
1: If I am doing floating multiplication, Square root and Division, It takes too much time approx(2-3 micro second and for square root (13 us)).
2: I also tried Fixed Point Calculation took Reference of STM reference manual but problem is same taking time in Micro-second.
So, I have to reduce floating calculation time near to 700-800 nano second.
If any one have idea about that, let me know. Thanks.
2019-08-19 10:25 PM
Perhaps looking for an integer-based algorithm of your problem ?
Or trying scaled math - using integer, and scaling the number up (before the operation) and down (afterwards) by the number of decimal fractions you require. It comes down to the accuracy you require.
2019-08-20 11:19 AM
These Methods I tried.
1 Method: Scaling up number before and down after calculation. Yes Accuracy is down and Timing in micro seconds.
2 Method: Partition of float number into mantissa and fraction (Float to Fixed conversion ) than do calculation. Accuracy is good but took too much time near 7-8 microsecond for single float multiplication.
For my requirements any method will be okay, condition-
Accuracy should be good and Float Multiplication time should below 1 microsecond.
2019-08-20 11:28 AM
Perhaps the 72MHz CM3 is not the appropriate part choice?
Run code from RAM, it will execute faster.
2019-08-20 12:36 PM
Precompute some of the match function in an approximate 2D points with linear interpolation between points.
That's what is done for 8 bit MCUs. Fixed point Q31 recommended when useable.
Change the core to M4 or use a faster core are another option when the expectations are misaligned with the provided implementation.
2019-08-20 01:24 PM
Multiplying by reciprocals beats division