cancel
Showing results for 
Search instead for 
Did you mean: 

Facing Timing Issues with Floating Calculation on STM32F103c6 ( Cortex m3)

vivek yadav
Associate II

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.

5 REPLIES 5
Ozone
Lead

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.

vivek yadav
Associate II

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.

Perhaps the 72MHz CM3 is not the appropriate part choice?

Run code from RAM, it will execute faster.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

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.

Multiplying by reciprocals beats division

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..