Hi
Made time over the holidays to do some tinkering on a mega48. Set up a adc with a simple 10Kpot and a small program( as found here ) and got it putting out values to a terminal program . Got values from 0 to 255 ,Great! Next ,used that value to update the OCR0A reg. to be able to vary my frequency out of the OC0A pin in CTC mode.Worked . Was able to vary the clock (OC0A pin) into my stepper driver with good results.
I decided to try PWM with the same program(not for steppers but for servos) . Started to change some of my settings when I noticed that I had accidently set the WGM02 bit in CTC mode. For a while could not get PWM to work #!#$%!? Finally Cleared the WGM02 bit and it worked. I have no interrupts running, just a simple loop that looks for keypress to do update the adc into the OCR0A reg.
It seems that the WGM02 bit is doing the opposite of what I thought it should be doing . Well I still have some time left ,so on to timer1 and more
headshaking. Hope this helps someone .
Pete