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.

CCS/MSP430G2553: MSP430G2553

Part Number: MSP430G2553

Tool/software: Code Composer Studio

In an attempt to generate SPWM using MSP430G2553, I am generating a carrier of 2.5kHz and a modulating wave (sine) which I learnt is to be hard coded from several online forums.

#define pwmPeriod 400               // carrier of 2.5kHz and reference of 50Hz. PWM period is 0.4 ms.

//const unsigned int phalfcycle[25] = {475,512,549,586,623,660,697,734,771,808,845,882,921,882,845,808,771,734,697,660,623,586,549,512};
//const unsigned int phalfcycle[25] = {100,123, 145, 166, 187, 206, 232, 239, 252, 263,271, 277, 280, 280, 277, 271, 263, 252, 239, 223, 206, 187, 166, 145, 123};
const unsigned int phalfcycle[25] = {200, 223, 245, 266, 287, 306, 323, 339, 352, 363, 371, 377, 380, 380, 377, 371, 363, 352, 339, 323, 306, 287, 266, 245, 223};
//const unsigned int phalfcycle[50] = {512,580,614,648,682,716,750,785,819,853,887,921,887,853,819,785,750,716,682,648,614,580,512,461,410,359,308,257,206,155,104,53,2,53,104,155,206,257,308,359,410,461,512};

I am unable to gauge, what is the math behind the values being entered in the sine wave array. Can someone help me out with that or provide some useful material to read about it.

Thanks in Adv.

**Attention** This is a public forum