Hi,
You have 36 values in you SIN table. To get a correct output you need each phase to cycle thru these 36 values. You get the phase difference by starting each phase 120° apart in the lookup table but from that point they will keep that phase difference if you reset the index pointer to 0 when they reach 36:
Name:  SIN_PWM_2.JPG
Views: 68909
Size:  39.3 KB

If you don't reset it to 0 but instead keep restarting the second phase at the 12th value (like you're currently doing) the output will look something like this:

Name:  SIN_PWM_3.JPG
Views: 68620
Size:  46.6 KB

Why? Because the second phase never "gets" the first 12 values of the lookup table so the output gets A) distorted and B) of another frequency since it doesn't contain the same number of "samples" as the the first phase.

Thinking even further and adding the third phase, starting at the 24th value keep restarting at 24 the output would look something like:
Name:  SIN_PWM_4.JPG
Views: 68936
Size:  43.9 KB

I hope you see that the above is not correct and that you understand WHY it's not correct.



Using your lookup table, starting the pointers at 0, 12 and 24 and restarting them all at 0 when they reach 36 the output looks like:
Name:  SIN_PWM_5.JPG
Views: 69174
Size:  45.6 KB
Which I think is more inline with what you're after, isn't it?

Now, the waveform is distorted because you have the value 512 as the first AND as the last the value in the table which means that you'll get a dutycycle of 512 for two "samples" in a row. That is where th flat spot in the wave form is comming from.

/Henrik.