C2000 gurus,
We have seen a few requests for a IQlog() function. In the attached library there is a preliminary log function for you to give a try.
Thanks goes to Alex T for coding and optimizing this.
Cheers,
-Lori
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.
C2000 gurus,
We have seen a few requests for a IQlog() function. In the attached library there is a preliminary log function for you to give a try.
Thanks goes to Alex T for coding and optimizing this.
Cheers,
-Lori
Hi Lori,
I try to use the IQlog function bud I get the following error.
<Linking>
undefined first referenced
symbol in file
--------- ----------------
_IQlogTableCoeff ...\\IQmathLog.lib
>> error: symbol referencing errors
Any idea how I can solve this?
Thanks
Hans
Hans Vandenbussche said:Hi Lori,
I try to use the IQlog function bud I get the following error.
<Linking>
undefined first referenced
symbol in file
--------- ----------------
_IQlogTableCoeff ...\\IQmathLog.lib
>> error: symbol referencing errorsAny idea how I can solve this?
Thanks
Hans
Hans,
I tried to reproduce the error without luck. The error indicates the table is not found, but it is included in the library. Are you still having the issue?
As a side note, this function was integrated into the latest IQmath release: V15c which is available in controlSUITE (www.ti.com/controlSUITE).
More on controlSUITE here: http://processors.wiki.ti.com/index.php/ControlSUITE_for_C2000
-Lori
EDIT: log function is not integrated into the 1.5c release
Hi Lori, thanks for your answer. I installed the controlSUITE and currently I'm using the IQmath V15c. Seems there is no IQlog function integrated. I don't find anything back in the (new) header file?! I'm still having this issue, any help would be appreciated.
Thanks
Hans
Hans Vandenbussche said:Hi Lori, thanks for your answer. I installed the controlSUITE and currently I'm using the IQmath V15c. Seems there is no IQlog function integrated. I don't find anything back in the (new) header file?! I'm still having this issue, any help would be appreciated.
Thanks
Hans
Hans,
I am embarrassed - I misspoke. The IQlog is not integrated into the v1.5c release. My apologies. Unfortunatly I am not able to reproduce the problem with the IQ log function attached to this thread. I will try a few more things today to see if I can reproduce it.
-Lori
Hans,
Which version of the code generation tools are you using? It will be something like 5.2.... You can find it on the top of any generated .map file.
-Lori
Hans,
I was able to reproduce the issue using codegen 4.x. It doesn't seem to happen with newer codegen tools.
I've attached a fix to the library that will allow it to work with the older codegen. Please let me know how it goes.
-Lori
Dear Lori,
I am very excited to see that there is log() support now in IQMath. I tried installing it onto my system using Code Composer 4.1.2.00027.
I put it in the IQMath folder, then add the path in the includes section in the Compiler section and the IQmathLog.lib File Search Path in the C2000 Linker section.
I implemented the code to your example (see below) but get a linker error:
"unresolved symbol _IQ24log(long), first referenced in ./FrontPanel.obj"
Do you have any ideas why this would happen?
Thanks - Cyril
-----------------------------------------
#include "IQmathLib.h"
#include "IQlog.h"
...
main()
{
_iq x;
_iq y;
....
y = _IQ(1.5);
x = _IQlog(y); // x = 0.405465108
}
Just a follow-on...
I did try explictily Linking the file IQMathLog.lib to the project in the Projects window....
Code Generation tools: TMS320C2000 Linker PC v5.2.3
Line in MAP file when I get this error:
UNDEFED __IQ24log__Fl 003ff3c2 __IQ24sin 003f6f77 __IQ24toF Not sure if this helps at all.... Thanks! Cyril
One more curiousity... this is a C++ project. Could that be causing the issues?
Hello,
This issue has been resolved. The code example was updated to use
extern "C"
{
#include IQlog.h
}
Please refer to the updated readme.txt.
August 3rd, 2010
Preliminary IQmath Natural log function.
Two libraries are included:
(a) IQmathLog.lib: This build of the library can be linked with code built for fixed-point.
(b) IQmathLog_f32.lib: This build of the library can be linked with code built with the --float_support=fpu32 switch.
This can be useful for mixing IQmath with native floating-point code on devices with the C28x+FPU.
This library includes only the natural log function:
_iq _IQlog( _iq A) ; Q = GLOBAL_Q
_iqN _IQNlog( _iqN A) ; Q = 1-29
Cycles: ~148 (includes call & return)
This function does not use a lookup table.
Example:
#include "IQmathLib.h"
#include "IQlog.h"
...
main()
{
_iq x;
_iq y;
....
y = _IQ(1.5);
x = _IQlog(y); // x = 0.405465108
}
Example C++:
#include <stdio.h>
#include <stdlib.h>
extern "C" {
#include "IQmathLib.h"
}
extern "C" {
#include "IQlog.h"
}
#include "IQmathCPP.h"
inline iq24 IQ24log(const iq24 & x)
{
iq24 temp;
temp.val = _IQ24log(x.val);
return temp;
}
int main(void)
{
iq24 one, two;
two = IQ24log(1.5);
one = IQ24log(two);
}
Hey All,
IQlog works great once I remembered the C++ issue! Thanks for the support Devin.
Now, what's the chances of an IQpow(n,x) function? I use a lot of equations with 2**x...
Is there any tricky way to do that right now using IQMath?
(I am using a F28033 on this project.... using that standard math.h function - it takes 75 usec!)
Thanks again,
Cyril
Hi Lance,
I'm now using IQmath for C64x+. Can you or somebody else who is interested in IQmath, run the following code
1) set GLOBAL_Q (18)
2) run
temp=_IQlog(_FtoIQ(0.025));
Here temp is a _iq number.
Theoretically temp should be negative number, but I got a positive number which is wrong. Thanks, David.