Foghorn 8 Posted April 15, 2014 Share Posted April 15, 2014 I've been waiting for quite some time for some decent fixed-point library support from TI for the G Series and looks like we finally got it. The link to the libs is at the link below: http://www.ti.com/tool/msp430-iqmathlib?DCMP=ep-mcu-msp-iqmath-en&HQS=ep-mcu-msp-iqmath-em-tf-en&sp_rid_pod4=MTcwNDA5NzM3MzUS1&sp_mid_pod4=45625358&spMailingID=45625358&spUserID=MTcwNDA5NzM3MzUS1&spJobID=421682205&spReportId=NDIxNjgyMjA1S0 They even give benchmarks for the performance of an MSP430G2553 when using the various functions in the libraries. Quote Link to post Share on other sites
drkm 7 Posted April 15, 2014 Share Posted April 15, 2014 I am super excited for this! I hate writing fixed point maths, it takes forever to debug and test. Where did you see the benchmark code? Quote Link to post Share on other sites
Foghorn 8 Posted April 16, 2014 Author Share Posted April 16, 2014 I attached the IQMath Library documentation shown below. Starting on page 88 of the document, you'll find the benchmarks for the MSP430G2553. MSP430-IQmathLib-01_00_00_00.pdf Quote Link to post Share on other sites
thomasss 0 Posted May 4, 2014 Share Posted May 4, 2014 Guys, Please help !!! This Qmath library is Aweful !! why is nothing working? I mean, they have a crazy example Signal_FFT but how is this supposed to help me understand the basic functions? Why don't they have a quick example to show how each function is working? I am trying to just do a division: (how can this be so damn hard to do a DIVISION!) ( Don't get me wrong, I am really glad they come up with this Qmath library, Thank TI, But please make it easier to understand) Here is the code I tried: #include "msp430.h" #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <QmathLib.h> int main(void) { _q12 f1 = _Q12(7.0); _q12 f2 = _Q12(1.0); _q12 f3 = _Q12div(f2, f1); return 0; } I have a breakpoint just before "return 0;". When I run this f1 turn to be 0 and f2 turn to be 585. So 1/7=0.142857 and 1/7*2^12=585.14. So f3 should be 585, not f2. And why f1 =0? I also tried their code: #include "msp430.h" #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <QmathLib.h> int main(void) { _q12 X, Y, Z; X = _Q12(1.0); Y = _Q12(7.0); Z = _Q12div(X ,Y); return 0; } CCS tell me there are errors in this code and don't even want to load the code in the msp430. If someone has been able to make the Qmath library work, I would really appreciate some help as i spent 2 hours just trying to figure out how to do a division and it is still not working. Thanks in advance for you help. Quote Link to post Share on other sites
thomasss 0 Posted May 4, 2014 Share Posted May 4, 2014 Alright, This works better: #include "msp430.h" #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <QmathLib.h> _q12 _Q12div(_q12 A,_q12 ; _q12 X = _Q12(1.0); _q12 Y = _Q12(7.0); _q12 alpha; int main(void) { alpha = _Q12div(X ,Y); return alpha; } That would be nice to have a small code like this for other functions though. Please post if you have been using other ones. Thanks Quote Link to post Share on other sites
Foghorn 8 Posted May 5, 2014 Author Share Posted May 5, 2014 Did you follow how to add the library to a project in CCS? It's listed in the documentation. I attached a snippet of the IQMath doc that can be found below. Also, I noticed that the CCS debugger also did strange things for me with the example program, too. The values shown in the debugger appear incorrect but the program works just fine. Kinda weird. I'll have to check it out more in-depth. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.