seyyah
Advanced Member level 2
atmel avr pwm sinusoidal look-up table program
I'm producing spwm at different frequencies. I have sin table. At low frequencies i make the duty cycle change slowly at constant period (carrier signal's period). At high frequencies make it change more rapidly. E.g
Sin Table (Assume that letters are sin values)
____
a
b
c
d
e
f
g
h
i
j
In low frequency duty cycle (DC) changes like this at every end of the period:
1- DC=a
2- DC=b
3- DC=c
etc
But as frequency goes up it changes like this
1- DC=a
2- DC=c
3- DC=e
etc. This method works. But i wonder is there a more general or easy way to do this? Especially to achieve more frequency steps. I make the changes for 1Hz. But i would like to achieve 0.1Hz or more without a significant load onto the program or dsp.
I'm producing spwm at different frequencies. I have sin table. At low frequencies i make the duty cycle change slowly at constant period (carrier signal's period). At high frequencies make it change more rapidly. E.g
Sin Table (Assume that letters are sin values)
____
a
b
c
d
e
f
g
h
i
j
In low frequency duty cycle (DC) changes like this at every end of the period:
1- DC=a
2- DC=b
3- DC=c
etc
But as frequency goes up it changes like this
1- DC=a
2- DC=c
3- DC=e
etc. This method works. But i wonder is there a more general or easy way to do this? Especially to achieve more frequency steps. I make the changes for 1Hz. But i would like to achieve 0.1Hz or more without a significant load onto the program or dsp.