Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Regarding 50Hz sine wave PWM!

$
0
0

To generate 50Hz sine wave PWM using sine table, I am somehow unable to decide the clock settings. Can anyone please help me out?

Useful details:

Timer Period = 0xFF=256 cycles of CLKIN

total no. of  Sine table entries for one sine cycle =  256

Now, since I have to generate 50 Hz sine wave, the input frequency to the timer should be approx. 50 x 256 x 256 =3276800 cycles = 3.2768 MHz

I need HSPCLK register free as I want to LINEARLY vary the sine frequency from 5 Hz to 50 Hz, with the ADCRESULT. Say when ADCin=0V, fsine=5Hz and when ADCin= 3V, fsine=50Hz. Linear variation wont be possible by changing TCON register value.

 

 

 


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>