I am having a bit of trouble trying to determine what the actual resolution I get on a PWM through analogWrite() is.
I am on a 4.0 board. My PWM is fixed @ 40kHz, and I have set the resolution to 12b like this:
analogWriteFrequency(2, 40000);
analogWriteResolution(12);
Now, the docs says the optimal frequency for this resolution is 36621.09Hz, which I am above. Does this mean, that my resolution goes down a whole bit?
Also, does it make any difference whether I use a FlexPWM timer or a QuadTimer? Or if i change the CPU speed? The PWM must be 40kHz, but I need the resolution as high as I can get it.
Thanks in advance
I am on a 4.0 board. My PWM is fixed @ 40kHz, and I have set the resolution to 12b like this:
analogWriteFrequency(2, 40000);
analogWriteResolution(12);
Now, the docs says the optimal frequency for this resolution is 36621.09Hz, which I am above. Does this mean, that my resolution goes down a whole bit?
Also, does it make any difference whether I use a FlexPWM timer or a QuadTimer? Or if i change the CPU speed? The PWM must be 40kHz, but I need the resolution as high as I can get it.
Thanks in advance