I has alterate the timer 2 frequenzy (I had lern how to do it by modificating the three last bits), but I would like to know somethin, when you do not tuch the timer frequenzy, your range is between 0-255, so what is it going to be my new range? is it the new top I had put?
Thank you very much! and what if my top value had begin to small, like 100... it doesn't leave me a good range... should I change the prescaler, and stuff to get a bigest range?
The 255 steps of resolution for the arduino analogWrite() PWM function is a basic hard limit of the function. However one can use a map function to convert a larger range of numbers, such that they will be scaled down and converted linearly to a 0-255 step range, and that may be all you require, depending on the requirement and objective of your project.
joamanya:
I'm driving a DC motor and I need 20Khz PWM, but doing that it becam that my range is from 0 to 100, so you recomend me map it?
First, why do you feel you have a need to change the arduino default PWM frequency to 20khz just to modulate the power going to a simple DC motor? Only when we fully understand your need/justification can we work towards a 'best' recommendation.