Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How do you RATE keil's 51 FLOATING POINT lib??

Status
Not open for further replies.

eltonjohn

Advanced Member level 4
Joined
Feb 22, 2002
Messages
1,434
Helped
64
Reputation
126
Reaction score
29
Trophy points
1,328
Activity points
16,329
keil floating-point error

I'm doing some floating point routines using keil and its floating point lib .
The cpu i'm using is a 20 mips chip .but i wsa surprised that for 3 of multiplications and 3 additions even on a fast chip IT TOOK so long ! .almost 20 uSecs .i can't use this !.. I did a search on the net and found plenty of floating points sources .
Has anybody gone through this ..what's your feeling on keil's floating point libs .!
or any advice to give before i spend hours trying to make sense of all this !
 

I have also gone through this a wile ago and my conclusion was to avoid FP whenever possible.

You can often do the same using int32 without loosing precision and speed :)

If you post what you want to do maybe I can assist you with some tips?

best regards
 

HI C-man
Thanks for your kindness ..listen i'm implementing a PID controller using :
typedef struct PID {
double SetPoint; //Desired Value
double Proportion; //Proportional Const
double Integral; //Integral Const
double Derivative; //Derivative Const
double LastError; // Error
double PrevError; // Error
double SumError; // Sums of Errors

}PID;


double PIDCalc ( PID *pp, double NextPoint )
{
double dError, Error;

pp->SumError += (Error = pp->SetPoint - NextPoint);
dError = pp->LastError - pp->PrevError;
pp->PrevError = pp->LastError;
pp->LastError = Error;
return ( pp->Proportion * Error
+ pp->Integral * pp->SumError
+ pp->Derivative * dError
);
}

i did got rid off all the structures and rewrote the code with simple variables and even got rid off the function altogether and i see in simulation that most of the time is SPENT on the final calculation .. next step i was going to do is to use assambler and do the computations using registers .
i also tried using 16 bits values .. and still TOO long .. i found a nice assambler lib on the net that does MAC 32 bit so i thought to give it a try ..!
 

can u post the link?
i would like to have a look at it.
many times short-cut method have resulted in long hours of debugging for me.
this is the only reason i preffer keil.
the lib resultes are dependable. and the code is bug free. it may be slow though.
hock
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top