With backlights, it is not always that simple. The colour rendition quality, may only hold up when the LEDs receive a significant amount of current (for arguments sake, let's stick with the 15 milliamps, previously discussed). So, if you PWM the LEDs, the on part of the cycle is always at the same 15 milliamps, which can help give the best colour rendition (colour gamut).
But, as nice as it might sound, if you linearly controlled the current, it may not give the full/correct colour balance (gamut), at lower current levels.
This is absolutely true, and I was aware of this.
During operation, I want the LEDs to be driven at a constant current (somewhere between 10mA and 20mA each, haven't decided yet; need to test in different lighting conditions to decide). However, I want both turn-on and turn-off to be smooth; so between zero and the max, there is only a ramp (that is not linear either) that takes about half a second or so. I can easily generate the desired PWM or PDM pattern, and adjust the max current by tuning the resistors or replacing them with pots, so you could say that the fixed version of Benta's circuit is the solution I was looking for.
There probably is a way to do the ramping in hardware as well, but I prefer to have the option to just switch the backlight on and off at command, with the ramping optional and configurable. And yes, I am aware of that I could also do this in software, using either the gamma control (available on ILI9341 and similar display controllers I'm using) or by just blending in the framebuffer from black, but that loses color resolution. I'm not after quick-and-easy; I want to know the different ways of doing this stuff
right, but without going completely Blabbo the Verbose Overboard on it.
Having more than one tool to do the job is always a plus. Because this is a hobby project, I'm using the opportunity to find out the different ways of doing this kind of stuff, and exploring them in simulators (QUCS since easy UI) and EasyEDA (as actual schematics and boards).
While the upper half of the current range is used for steady state operation, it'd still be nice to be able to get the LEDs down to really dim, so that the ramp does actually feel and seem like a ramp, and not like a light stabilizing after being turned on. With Benta's circuit, the minimum maximum-intensity current pulse across the LEDs takes about 20µs, which means that at 250 Hz PWM, the minimum
effective duty cycle is 0.5%; at 1 kHz, 2%; at 5 kHz, 10%. So, for my purposes, I'm really limited to PWM frequencies between 250 Hz or so (because I hate flicker, and can definitely see 100Hz flicker) and 1000 Hz (because otherwise I lose the resolution at the low end).
With current control, especially with say 20mA/256 steps = 0.078125mA per step (or 12.8 steps per mA, or 0.4% of full range per step), the minimum current would be around 0.1mA or so, which is definitely dim enough to not be perceived as "fully on". And even dual and quad 12-bit DACs with internal bandgaps (MCP47CVB24, MCP48CVB24) (giving a resolution of about 5µA at the upper half, for balancing the LED currents digitally) are within realm of possibility since they are actually somewhat available still, although they would double the price of the panel (from about $10).