This is more of a general EE question than an 8-bit MCU question, but one that folks here might have good insight on.
For many applications (eg. switching power supplies) it is useful to have a PWM in the >500 kHz range, with a duty cycle that can be finely tuned. A typical MCU is not fast enough to provide this signal off of the main bus clock.
Is there a cost effective way to implement a PWM operating at 500 kHz, finely variable duty cycle, with an MCU? Say, by converting (directly or indirectly) a 500 Hz PWM from the MCU into a 500 kHz signal using an external IC, or simply a crystal oscillator with some clever analog circuitry?
I have been googling around on this and have found some rather inelegant possible solutions, but I was wondering if anybody had quick advice here.