I am working on a project that I need to do a high frequency PWM (50KHz) with a variable duty cycle. As we change the duty cycle, we get varied results of resolution. We are running a Mega8 at 8MHz. I though there was an option to set a high-speed PWM mode that would I/O clock at 24MHz, but I can't find it in the datasheet.
Is there a better way to set the duty cycle on Timer2, than the FastPWM and change the TCNTn value for the frequency and OCRn for the duty?