Topic: LCD Dimming

There has been a lot of talk on this forum about dimming the LCD to intermediate backlight brightness levels, and the standard response has been that it's a hardware limitation: only full-on, dim or off are supported.

Is a hardware hack to get PWM-controlled 0%-100% LCD backlight brighness possible without too much trouble?

Looking at the r37 schematics, on page 3, I see that C523 (and R501) limits the rise/fall time of LCD_BRIGHT to about 2.2ms making PWM difficult (certainly at a high enough switching frequency to avoid flicker). Maybe this was done to avoid feedback loop instability in U501, the backlight inverter... I don't know, I haven't looked at the datasheets properly yet.

If you removed C523 and applied a PWM waveform to LCD_BRIGHT (pin A19 on the MX21) would you be able to dim the backlight or would the inverter go unstable? (Or some other problem I haven't thought of :-) Also could you increase(?) the resistance of R525 and R526 to decrease the dimmed LCD brightness (this would be minimum brightness available in the aforementioned possible PWM scheme)?

As for generating the PWM signal, easiest way would appear to be to use a spare GPIO on the cryptoprocessor (easiest to code that way), or use PWMO in the MX21 (pin H19, available at test point J107) and hack up some code in the kernel to control it.

Bunnie or others, any comments? Thanks!

Re: LCD Dimming

The switchmode boost regulator used to create the backlight voltage for the chumby was intended to be operated in an "on or off" only mode; it's actually a boost voltage-mode regulator by design that we've modified to be a current-mode regulator. Current mode regulation is important because the LED light output is better correlated to the current through the LED, and not the voltage. Lot to lot variation and aging of the devices means that a voltage mode regulator will lead to non-uniformity in backlight brightness. By utilizing this regulator instead of including a separate current mode regulator, we save significant $$$, which is a constant challenge when building a device as feature-rich as the chumby selling at such a low price point.

Since the regulator wasn't designed to be operated in a PWM mode, it was decided not to drive it as such. It works with a slow PWM chop but the waveform is pretty unstable and you get some rippling/shimmering effect on the screen when this is happening. So, you could apply a PWM signal to it and it will work on some units but the light uniformity output was not deemed adequate for a product that we ship to customers.

On the other hand, if the dim mode is not dim enough for you, a simple fix is to just increase the value of R525 and R526. The reason it wasn't trimmed any dimmer is that the current is already so low that we run the risk of not having adequate current to start the regulator up. It will work on some units, but again parametric variation is your enemy and we want a high-yielding product. It was reasoned that most people would be okay with how dim the night mode is on the chumby--there's always someone who wants it dimmer, but perhaps for those individuals its best to just shut the screen full off, which is possible in software.

7BAA 2E53 01C1 DCFF 497B  E7F0 9699 A303 78F0 D9B9

Re: LCD Dimming

Screen full off?
How would I do that? that'd work for me as long as it turned back on in the morning with my alarm..

Re: LCD Dimming

I think it's the case that this is a hardware feature but the current control panel that you see does not expose it. So you can cause this behavior to happen but only if you are willing to ssh into the device and cause it to happen.

I'll point duane at this thread to see what he thinks.

7BAA 2E53 01C1 DCFF 497B  E7F0 9699 A303 78F0 D9B9

Re: LCD Dimming

Yeah it's not exposed in the current Control Panel - the design folks thought there was little utility in a UI interface to simply turn off the display since it wouldn't be clear how to turn it back on.  One *could* turn it back on based on manipulation of the device (touch the touchscreen, whatever), but then it meant that you were stuck in the brightness screen with no way to exit without turning the display back on.

Having the display turn on, then timeout back to off is an interesting approach, but not obvious to a user.

Re: LCD Dimming

In my opinion it should be a Night-Mode-option to turn off the LCD, the touchscreen and the wifi. I use a  script that does exactly that and it works great and very intuitive: after some seconds of nightmode the screen turns to black and when I hit the top-button the display goes on again and I'm in the control panel as every user would expect.

Re: LCD Dimming

Yeah, why not just have a "Turn off screen" night-mode option? It would behave just like normal night-mode, would that be hard?

Also, WHats the command to turn off the display? To turn back on? Curious..

Re: LCD Dimming

The brightness is controlled by the procfs file /proc/sys/sense1/dimlevel:

0 = full bright
1 = dim
2 = off

For instance:

# echo 2 > /proc/sys/sense1/dimlevel

...will turn off the screen.  Replace the '2' with '0' to turn it back on, and '1' for dim.

Re: LCD Dimming

I've been experimenting with this command and found that if you go from 2 (off) to 1 (dim), the screen comes back on but looks weirdly inverted. Setting it back to 0 fixes this condition. Going from 2 to 0 works fine.

Re: LCD Dimming

That's correct, the proper procedure for going from off to dim is to quickly transition through the on state. The scripts that run behind the scenes on the chumby do this for you. If you just do

echo 0 > /proc/sys/sense1/dimlevel; echo 1 > /proc/sys/sense1/dimlevel

the transition is so brief you cannot see it.

The reason for this is that the integrated LCD bias generator uses the backlight voltage to prime a set of charge pumps that generate the bias voltages for the LCD. Once the pumps are primed, the voltage can drop to the dim state. If you go from off to dim, the voltage going to the LCD backlight is so low the charge pumps never prime and the LCD never get biased correctly. 

Just a tiny pulse of voltage is needed to prime the pumps, and executing the two commands in rapid sequence does the trick for you. This could also have been integrated into the kernel driver, but it was decided that instead of creating a timer process or dead-waiting to do this, it was more flexible and efficient to do the call at the user level.

7BAA 2E53 01C1 DCFF 497B  E7F0 9699 A303 78F0 D9B9

Re: LCD Dimming

Hmm. I seem to have trouble keeping the screen in check doing:
echo 2 > /proc/sys/sense1/dimlevel
***And Then***
echo 0 > /proc/sys/sense1/dimlevel; echo 1 > /proc/sys/sense1/dimlevel


I get the same inversion problem either way, not a problem for me though.
I'm just glad I can turn my screen off at night, even with the hassle of having to set it with a comp.

Could a widget issue the command? I thought I read somewhere that widgets don't have access to certain files like "/proc/sys/sense1/dimlevel".
That directory root-only?

Re: LCD Dimming

From Flash, you'd use the appropriate ASnative calls.

These calls are disabled for widgets, but are accessible to movies run locally.

Re: LCD Dimming

I had the same problem with the inversion.  I found that to go from "OFF" to "DIM", it had to stay at "ON" for a few hundred milliseconds to charge things up.  (This is on an Ironforge Chumby.)  I wrote this little shell script, which goes through the levels from "OFF" to "BRIGHT" in 5 second increments:

#!/bin/sh
#do "OFF"
echo 2 > /proc/sys/sense1/dimlevel
sleep 5
# do "DIM"
#handle hardware limitation in Chumby; must go through "ON" for a little while to charge up
echo 0 > /proc/sys/sense1/dimlevel
sleep 1
echo 1 > /proc/sys/sense1/dimlevel
sleep 5
# do "BRIGHT"
echo 0 > /proc/sys/sense1/dimlevel

--Steve KA9MVA

Re: LCD Dimming

I get no response when echoing 0, 1 or 2 to /proc/sys/sense1/dimlevel... any thoughts on fixing this?

at the moment my day brightness is about 50% and the night is just a touch above completely dark... and i do get accurate responses when i use the brightness sliders in the control panel, just nothing from the command line.

Re: LCD Dimming

jyee wrote:

I get no response when echoing 0, 1 or 2 to /proc/sys/sense1/dimlevel... any thoughts on fixing this?

The procfs file /proc/sys/sense1/dimlevel only works on "2008" chumbys - the "2009" chumbys use a different mechanism in order to give a full range of brightness.  They also do not have the "inversion" issue.

Try putting values between 0 and 65535 in /proc/sys/sense1/brightness

16 (edited by jyee 2009-01-14 21:18:28)

Re: LCD Dimming

Thanks Duane,

looking in /psp, there's a daymode_brightness and nightmode_brightness... are those just multipliers to output a number to /proc/sys/sense1/brightness?

edit: nevermind, after playing in the CP, i realized that it's the brightness percentage 0-100... so yes, it's a multiplier for the 0-65535 brightness range.

Re: LCD Dimming

Duane wrote:
jyee wrote:

I get no response when echoing 0, 1 or 2 to /proc/sys/sense1/dimlevel... any thoughts on fixing this?

The procfs file /proc/sys/sense1/dimlevel only works on "2008" chumbys - the "2009" chumbys use a different mechanism in order to give a full range of brightness.  They also do not have the "inversion" issue.

Try putting values between 0 and 65535 in /proc/sys/sense1/brightness

sounds like the Wiki needs to be updated for the 2009" chumbys

18

Re: LCD Dimming

Chumby One:

The Chumby One doesn't appear to have a /proc/sys/sense1.  Any tips on dimming the display?

Re: LCD Dimming

The equivalent for chumbhy one is:

/sys/devices/platform/stmp3xxx-bl/backlight/stmp3xxx-bl/brightness

It has the range 0..100

Re: LCD Dimming

Do you know why some people can write 10 to it, but with my chumby one the lowest I can send is 15, anything below 15 the screen goes completely dark?

Re: LCD Dimming

There's variation across devices, mainly due to component tolerances.

Re: LCD Dimming

Duane thanks for the clarification. smile

23

Re: LCD Dimming

Thanks Duane, by the way mine dims  smoothly from 100 to 10 (very dim) then to black at 9.

Re: LCD Dimming

Is there a way to have the screen go black after a specified delay when running on battery? When Pandora is the active widget, the screen runs at full brightness when on battery power until the battery dies. My preference would be that tapping the screen would "wake up" the display and then turn back off after the delay.
--tom