Timer Setup and PWM

Hello Everyone,

First off, thank you for taking the time to help me with my question.

My question is this:

Would it be possible to increase the resolution of the PWM on pin 11 of an Arduino nano from 256 to 2048? I'm using GRBL to control a small 40W laser engraver that I built and 256 power levels are not enough to get clear gray-scale color differences. I have been looking around at how to manipulate timers and such on Arduino since I am a fairly competent c++ programmer but I honestly have just gotten even more confused than I was to start.

/increase-pwm-bit-resolution

Let's see ... pin 11 is OC2A ... which is channel A on timer 2. Timer 2 is an 8 bit timer. So, the answer is no. The maximum granularity for an 8 bit timer is 256.

Timer 1 is a 16 bit timer. Either OC1A or OC1B can be used for what you want. I suggest using a granularity of 65536 instead of 2048 so that both channels can be used with pulse width modulation.

Oh, wait. The granularity may not matter. Timer 1 has a separate register for the overflow count.

Thanks for the tips, I think I may be making progress. I this is a difficult subject to conceptualize though.