I am puzzled over what your problem you seem to perceive that you have.
I regularly use PWM at much higher frequencies without having to change the processor clock. All you have to do is to change the prescaler register driving the PWM.
void setPWMtimer(){
// Set timer1 for 8-bit fast PWM output to use as our analogue output
TCCR1B = _BV(CS10); // Set prescaler to full 16MHz
TCCR1A |= _BV(COM1A1); // Pin low when TCNT1=OCR1A
TCCR1A |= _BV(WGM10); // Use 8-bit fast PWM mode
TCCR1B |= _BV(WGM12);
OCR1AL = 0x80; // start PWM going at half maximum
}
You may run into trouble of handling the small pulse differences of 12 bit resolution in hardware. Counting pulses is exact, but it does not require a specific duty cycle. Measuring the exact pulse width is much more complicated, and conversion into voltage by a low pass filter will result in ripple. How do you want to process your PWM signal?
@Grumpy_Mike
Yes it works fine for 8 bit, but 12 bit requires higher IC speed clock, doesn't it ?
@DrDiettrich
I'm lighting on and off LED at very slow rate (several seconds), using a low pass filer at PWM output.
It works fine under 5s, but you can notice scaling at slower ignition rates. I was wondering if 12 bit could smooth things out.
I think you are misunderstanding something here about how PWM is implemented in the hardware of a processor.
An 8 bit PWM requires 8 bit registers to control it. Using 12 bits simply require 12 bit registers, which do not exist. However timer 2 (I think) is capable of using two registers together to make a 16 bit register, and that allows you to do 16 bit PWM on a Uno. Of course you can use only 12 bits of that 16 bit register to work with if you so chose to do so.
What you are running into is that the your eye is working on a logarithmic scale where as the LED is giving a linear output. What you need is a gamma correction on the values you apply to the light.
see:-
Sure 12 bits will give you more levels to go at but by itself it will leave you with the same problem.
@wadafukou is right. If Fast PWM TOP is set to 4095 then it takes 4096 clock ticks for 1 pulse. A pulse frequency of 20 kHz then requires a 81,920 kHz clock (82MHz).