Ok, I'm trying to understand the math behind how PWM work in terms of max frequency noise it can generate.
For instance, if I use a regular 8-bit timer and want Fast PWM output for Audio, what's the lower frequency it will generate by itself, so I can filter it. This way, I know the max sample-rate I can get. I'm also thinking on running the ATmega328 at 20Mhz, to get better audio output.
I'm trying to understand the math behind PWM, but so far the sites I found don't match the datasheet. For instance, this site below, tells me PWM frequency, with no scaler, is 62k for the 16 bit Timer but 31K for the 8 bit timer. While the datasheet shows that the 8 bit timer is actually CLOCK / 256 which would be 62k, not 31k. Hummm.... what gives? Did I read the datasheet badly?
Also, if the PWM frequency is 62k, does this means that the lowest frequency will be 62k or what? This way I would know that the lowest audible sound would be 62k, which no speaker can reproduce.
Just trying to understand the whole thing. Thanks for any input. 8)
Best Regards, WilliamK