Problem using modulo and sinus/cosinus functions with CCSv3.3, Embedded Coder and F28335
Show older comments
Hello, I'm using CodeComposer v3.3 and Matlab R2011b (Embedded Coder version 6.1).
I made a Simulink model where I generate a sawtooth between 0 and 2pi, at a given frequency; to do that, I made an integration of "2*pi*frequency", then I apply a 2pi-modulo using the "MOD" bloc in Simulink; then I apply sinus and cosinus on the result (with Simulink blocs "SIN" and "COS"). It works very well in simulation, but the behavior is wrong when I generate the code and execute it on F28335, especially at high frequency (sawtooth at more than 400Hz; sampling time is 100µs).
What could be wrong using MOD/SIN/COS bloc functions with embedded coder on F28335 DSP? Shall I use another math library in CCS? Let me know if you have any idea about that, or if you need any other information.
Thanks for reading. Regards, Julien
Answers (0)
Categories
Find more on ARM Cortex-M Processors in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!