Increase minimum PWM duty cycle for high resolution PWM

duty cycleledpwm

I'm working on a project involving driving LEDs at a 20kHz PWM frequency with 1024 bit resolution. I've calculated that the minimum pulse time, (1/frequency)/resolution, would result in a minimum pulse time of ~50ns, which means I need rise and fall times of <25ns of all of the components I'm using to turn the LEDs on and off. While there are components that meet this specification, it's pretty demanding and I'd like to use some cheaper, more widely available ICs.

My thought is that while 1024 resolution is useful in adjusting the output of the LEDs in fine increments in my use case, I don't actually need a minimum brightness of 1/1024, but could probably get away with a minimum of 1% of the total brightness, or 1024 x 0.01, which is roughly 10x the minimum pulse width or about 500ns. This results in rise and falls times of 250ns, which greater increases the number of available components.

Is my understanding of the PWM frequency, resolution and duty cycle relationship correct here?

Best Answer

Your calculations seem correct to me.

However, do you really care about the rise time being >25ns?

If you say you don't need the range below 1% brightness, then you can simply use only values in range 10 to 1023 out of 1023, and you therefore get a rise time of at least 10*50ns = 500ns.

If by mistake (or to simplify code/design) you still use the 0 to 9 out of 1023 range, then you will simply get in one of the following situations :

  1. The LED doesn't turn on at all (you don't have time enough to turn it on at all before starting to turn it off.)
  2. The LED turns on a little little bit (less than if you had instant turn on/off.)
  3. The LED somehow manages to turn on then turns off as quick as possible.

Which of the above will happen depends of the exact components you use for driving the LED (I would guess 1 or 2 are the most likekly.)

Between 0 and 9, you might not get brightness proportionnal to PWM, but you should get:

  • at least the same brightness as for 0
  • at most the same brightness as for 10
  • for any 2 numbers A<B, you will have brighness_A<=brightness_B

If you don't care about what exactly happens below 1% of brighness, either don't use values 1 to 9, or just accept the fact that you will not get perfect linearity for those.