I have seen several posts about PWM in order to make a one phase inverter, and most use a long values table calculated to get the sine wave, but what if it calculates the duty value each time?
I have a graph where can be seen some details, but I don't see the way to attach it. There I see I will have to compensate about 1/7 of cicle time due to the calculation time.
-----------------
counter=0
loop:
duty=sine[(counter/100)] ' to compesate decimal handle in above lines PWM
pin,duty,1 ´ PWM pin,duty,cycle at 11,718 Hz
counter=counter+ n ' 127 cicles n=1, n= 127/195= 0.65 -> 65
if counter= 19500 then counter=0
goto loop
-----------------
So, What do you think about it?
Thank you in advance for your answer
L.J.
I have a graph where can be seen some details, but I don't see the way to attach it. There I see I will have to compensate about 1/7 of cicle time due to the calculation time.
-----------------
counter=0
loop:
duty=sine[(counter/100)] ' to compesate decimal handle in above lines PWM
pin,duty,1 ´ PWM pin,duty,cycle at 11,718 Hz
counter=counter+ n ' 127 cicles n=1, n= 127/195= 0.65 -> 65
if counter= 19500 then counter=0
goto loop
-----------------
So, What do you think about it?
Thank you in advance for your answer
L.J.