My ADC value is 200 (50 Hz) and my new table has 72 entries from 0 to 350 in steps of 5.
My ADC value is 200 (50 Hz) and my new table has 72 entries from 0 to 350 in steps of 5.
If you haven't changed the prescaler it should work according to your equation.timer0 reload value = FFFFh - 5Mhz / (36*(8/4)(200)) = 65535 - 347 = 65188
5MHz/(72*(8/4)*(200)) = 5MHz/28,800=173.6
65,535-173=65,362!
If you go by equation 3 in AN900 it would be around 65,447 for a reload value.
I will test the software on my development board and see if I get a sine wave of 50Hz or not. Maybe Proteus is not simulating the program at the right clock speed.
Thanks
Bookmarks