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.
Hi,
I have included math.h in my code. The problem that i face is that whenever I include sin() or cos(), frequency of sensed variables goes wrong.
I dont know what is happening exactly. I am thinking of putting a LUT for sin ,cos. Can someone explain me how to do it. I dont want to use iqmath.
I am seeing waveforms on ccs v3.3 graph.
Thanks a lot
Shyam,
There is already a sine look-up table in the boot ROM of this device. This may be what you're looking for. Take a look at the boot ROM documentation: spru963a. That will tell you how to download the ROM source and tables.
If the problem is the sin() and cos() functions are taking too long to execute, you may want to look at the fastRTS library, which contains more cycle efficient forms of these functions. The library is in controlSUITE, and you can also download it at: http://www-s.ti.com/sc/techlit/sprc664.zip
Regards,
Richard
Shyam,
I'm not saying that. You were having problems when you used the sin() & cos() functions, possibly because of the execution time.
These functions are standard C routines in the run-time support library, however there is are faster routines available in the "fastRTS" library I mentioned. Alternatively, you could choose to use the ROM look-up tables directly in your code. It boils down to how fast you need the code to run and how much accuracy you need in the answer.
Regards,
Richard