0
\$\begingroup\$

Is there any significance other than the granularity of duty cycle levels?. I'm working on an led driver where the light output levels should be very smooth while dimming. There will be 254 levels of brightness. if it is just about brightness levels a 10bit PMW is enough, isn't it?. Is there something to do with PWM frequency and resolution considering the flickering of led. Any help would be very much appreciated.

Thanks

\$\endgroup\$

closed as unclear what you're asking by pipe, PeterJ, Dmitry Grigoryev, Voltage Spike, winny Sep 15 '17 at 10:40

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ The question is not very clear. Moreover, if you want 254 levels of brightness, what's the matter with a 16 and 10 bit PWMs? You can use a 8 bit PWM. When dimming (I assume you refer to the transition from bright and dim, and vice-versa) be assured thar 254 levels are enough to create a smooth dim... \$\endgroup\$ – next-hack Sep 6 '17 at 11:03
  • \$\begingroup\$ @next-hack 8 bit is not enough if you want 254 "good looking" levels, since an 8 bit DAC/PWM will most likely be linear. \$\endgroup\$ – pipe Sep 6 '17 at 11:10
  • \$\begingroup\$ The amount of visible LED flickering will be determined by the PWM frequency, not the duty cycle. However, the resolution you can obtain on the PWM is related to the frequency, since they are both depening on the PWM hardware's timer resolution pre-scaler capabilities. \$\endgroup\$ – Lundin Sep 6 '17 at 11:30
  • 2
    \$\begingroup\$ Now I get your point. You want, for instance, a log scale (or a particular gamma curve) to compensate for non-linear eye response. \$\endgroup\$ – next-hack Sep 6 '17 at 12:19
  • \$\begingroup\$ @next-hack yes you got it \$\endgroup\$ – raforanz Sep 7 '17 at 8:41
1
\$\begingroup\$

Trying to find the real question in your question, which is a bit unclear...

Is there something to do with PWM frequency and resolution considering the flickering of led.

PWM frequency is important: below a few hundred Hz, it will flicker, and this is unpleasant. But above this, your ceramic capacitors can whine, which is also annoying.

So, 25kHz is a good PWM frequency. Capacitor noise is inaudible, and it sure won't flicker. With 8-bit PWM this gives a minimum clock frequency of 6.4 MHz.

If your micro has a 8MHz clock and a 8-bit timer, then there is no problem, except if you want to allow very low light output.

If your LED puts out, say 256 lumen... then with the PWM at 1/256 duty cycle it still outputs one lumen. If you want lower, you'll have to use a PWM with more bits.

Note that PWM is not the only way to dim a LED. You can also control the current directly, if the driver allows this. This can be more efficient, but light output does not vary linearly with current.

\$\endgroup\$
  • \$\begingroup\$ I think the OP wants 254 levels not spaced linearly, but with another law. Therefore, indeed, he needs more than 8 bit (e.g. 16), and a 254-entry n-bit (e.g. n=16) look-up table... Still, with 16 bits he would need a huge clock frequency, to avoid flickering (especially if he needs to illuminate a scene to be caught on camera). \$\endgroup\$ – next-hack Sep 6 '17 at 12:20
  • 1
    \$\begingroup\$ Nice catch! Yeah, if this is for photography, then constant current would be better. Let's wait for him to share the precious information... \$\endgroup\$ – peufeu Sep 6 '17 at 12:25
  • \$\begingroup\$ Thanks for your replies. I will be more specific here. This is based on DALI protocol and I will be using an LED driver chip TPS92515HVDGQ. I will be driving the driver IC with PWM output from controller. DALI has 254 input levels. Will this be exactly converted to 254 PWM levels?. \$\endgroup\$ – raforanz Sep 6 '17 at 13:50
  • \$\begingroup\$ @peufeu I didn't get this point "With 8-bit PWM this gives a minimum clock frequency of 6.4 MHz". How resolution and freq are related?. Could you please explain more? \$\endgroup\$ – raforanz Sep 6 '17 at 13:53
  • \$\begingroup\$ @raforanz So you'll have a microcontroller that interfaces with DALI and outputs a PWM value? \$\endgroup\$ – next-hack Sep 6 '17 at 14:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.