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.

C28335 CCS (sine wave)

Other Parts Discussed in Thread: CONTROLSUITE

I'm trying to generate a sine wave on CCS v4.0 using C28335 as my target. The C code is below :

# include <math.h>

int x;
float k[360];

#define PI 3.1415926

void main(void)
{
        while(1)
           {

              for(x=0; x<360; x++)
                {

                      k[x] = (float)sin(x*(2*PI)/360);


              }

       }
}

but the numbers I get after execution seem to me like random numbers. Sometimes I get the right values till, say, 120 and then all values are set to 0. And rarely I get all the values right! 

My stack size is 400.

Could anyone tell what the problem is?

Thank you.