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 LAUNCHPAD-XL F28069M trigonometric functions problems

Other Parts Discussed in Thread: CONTROLSUITE

Hi !

I have problem with using trigonometric functions: sin(), cos() and atan2() on  F28069M microcontroller.
When I generate phase angle in 200 samples from range (-pi, pi) or (0, 2*pi):

and use sin(angle) from math.h the result is as follows:

and cos(angle):

with atan2() function I have similar issue. What could be the explanation and solution?

Kamil M.

  • Disassembly:
    230 sinus = sin(theta);
    008487: 761F0280 MOVW DP, #0x280
    008489: E2AF0020 MOV32 R0H, @0x20, UNCF
    00848b: 76409722 LCR $C:/ti/controlSUITE/libs/math/FPUfastRTS/V100/source/sin_f32.asm:62:96$
    00848d: 761F0280 MOVW DP, #0x280
    00848f: E203000A MOV32 @0xa, R0H
    231 cosinus = cos(theta);
    008491: E2AF0020 MOV32 R0H, @0x20, UNCF
    008493: 764096EE LCR $C:/ti/controlSUITE/libs/math/FPUfastRTS/V100/source/cos_f32.asm:62:96$
    008495: 761F0280 MOVW DP, #0x280
    008497: E2030008 MOV32 @0x8, R0H
    232 tangent =atan2(cosinus, sinus);
    008499: E2AF010A MOV32 R1H, @0xa, UNCF
    00849b: 764095E9 LCR $C:/ti/controlSUITE/libs/math/FPUfastRTS/V100/source/atan2_f32.asm:90:148$
    00849d: 761F0280 MOVW DP, #0x280
    00849f: E2030012 MOV32 @0x12, R0H
  • hello, I have exactely the same problem, and obtain the same waveforms... do you solve this problem?? regards
  • Yes, I solved this problem. I suppose that you try load example project from Control Suite.
    In C2000 LAUNCHPAD-XL F28069M is other microcontroler version F28069M and you must replace ram command file from your project.
    28069_RAM_lnk.cmd replace by 28069M_RAM_lnk.cmd
  • Dear Kamil,

    I replace the .cmf file and work perfectly!!!! .. I have been standing with this problem for several days !!!

    thanks a lot.!!!