2006-11-02 12:13 AM
Can ST7 do sine and square root caculation?
2006-10-12 09:56 PM
Can ST7 do sine and square root caculation?
if yes, are the sample code subroutine available?2006-10-12 10:29 PM
Hi,
your C-compiler will offer you these math functions sin() and sqrt() and others. Normally it's essential to include the math-lib (#include ). For further information see the C-compiler manual. Regards WoRo2006-10-16 04:52 AM
beside adding
#include to the program. What else do I need to take care in order to make it work? ex. any compiler or linker option2006-10-16 05:43 AM
Set up the LIB search path for the compiler if you haven't already done so.
Project > Project Settings > General in STVD7.2006-10-16 10:43 PM
Sorry, but this message-handler mismanages angle-brackets, so the text has been garbled.
Hope they'll now present the text in the right view (?): #include <math.h> If not please add ''math.h'' enframed by angle brackets. math.h defines more than twenty mathematic functions. You'll find them in ANSI-C descriptions as well as in C-compiler manuals. Regards WoRo2006-11-02 12:13 AM
The easiest way in STVD7 to manage the libraries is to select ''float'' in the linker project settings
=> Menu Project / settings => select linker tab => select ''input'' category and check the float checkbox. This will manage properly the libraries (depending also on memory model and it will link proper libraries in the proper order). The other point you must keep in mind is that the ST7 does not integrate floating point instructions. Thus the compiler provides libraries to manage such needs, but it may be quite slow. The alternative, if you know the range of value you'll have to manage is to pre compute a series of results and use a table to pick in it. Emmanuel.