New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question - Winstar OLED ws0010 dim brightness #185
Comments
On Mon, Sep 13, 2021 at 3:07 PM emanueleci ***@***.***> wrote:
Hi, i have an 20x4 Winstar OLED screen (HD44780 compatible, i2c wired with backpack), and it works perfect with latest DEV build.
I can also DIM screen using external backlight settings in LCDd.conf, so i can change from full bright to dim bright.
The problem is that now i need to implement a toggle to completely turn bright off and on, without the needs to clear screen. Is this possible?
I tryed to set OffBrightness to 0 in LCDd.conf but it doesn't seem to work.
Looking at the source for hd44780.c, I see a couple of implementation
details that stand out. In particular, in hd44780_set_brightness(), it
doesn't change the display so much as change the internal brightness
value then marks the backlight state "invalid" which will get
corrected on a future display update.
If you mean "how can I "dim" to 0 without writing to the display at
all?", I don't think that's going to work. Other parts of the code
skip sending chars if there are no visible changes, so without _some_
change to the contents of the display, it's likely that the
set_brightness is going to wait until there is a change.
Also, I see other places where it flips between WINST_PWRON and
WINST_PWROFF and doesn't use the value of off brightness directly, but
as a threshold for on vs off.
Between those two things, I don't think it's written to behave in the
manner you are describing. I'm not quite sure of the behavior you are
looking for (time-out power down? "wake-up" functionality? etc) but
any changes to the current implementation have to be written in a way
that doesn't break other drivers (only a few devices have fine-tuned
controllable brightness)
If you could describe in a little more detail how you want the
backlight to act (what triggers the change, especially), that would be
helpful.
|
hi @ethandicks, thanks for your time. Emanuele |
Hi @emanueleci I wrote support for Winstar OLED internal backlight handling some time ago, but I only wanted to map client-controllable backlight setting to high and low intensity instead of controlling LED backlight (connected to dedicated pin) on standard LCD screens. On the other hand I made some changes to work with other displays (VFD ones), which have four-level brightness setting and I wanted to make controllable brightness for other types of displays I wasn't aware of. It is achieved with
So this is little hackish, but you can try to use options below in
Command to turn off display is standard Display Off, and for maximum brightness is Display On (0xC0) followed by Winstar's specific enabling internal power (0x17). It should work, however I did't try this like that :-) I only made tests using Winstar internal commands 0x13 and 0x17. That way you should have display completely off when backlight is off and fully on, when backlight is on.
What do you mean LCDAPI? Do you use LCD commands from development guide?
Greets |
Hi @mskalski, thank you. Winstar OLED connected via i2C with PCF8574. Address is 0x27 model selected: Text is showed correctly, no garbage, no problem at all.
It looks like internal commands is not working in my configuration via i2C, while external works. Thanks, |
Hi, Emanuele Could you verify settings are parsed as expected? I usually run $ LCDd -c LCDd.conf -f -s 0 -r 4
$ LCDd -c LCDd.conf -f -s 0 -r 5 2>&1 | grep -v '^screenlist_' (the second one shows also backlight setting commands provided by client - filtered out of many "screenlist_" logs).* I tested with WEH001602A Winstar OED display with I2C backpack and with settings below: ## Server section with all kinds of settings for the LCDd server ##
[server]
DriverPath=/usr/local/lib/lcdproc/
driver = hd44780
Bind=0.0.0.0
Port=13666
#ReportLevel=4
#ReportToSyslog=yes
User=nobody
#Foreground=yes
#Backlight=open
Heartbeat=no
ServerScreen=no
Hello = Hello
## Hitachi HD44780 driver ##
[hd44780]
ConnectionType=i2c
Model=winstar_oled
Port=0x23
Device=/dev/i2c-1
Size=16x2
# Here is my required setup
i2c_line_RS=0x01
i2c_line_RW=0x02
i2c_line_EN=0x04
i2c_line_BL=0x08
i2c_line_D4=0x10
i2c_line_D5=0x20
i2c_line_D6=0x40
i2c_line_D7=0x80
# Use embedded commands to control brightness
#Backlight=internal
# Use provided below commands for brightness setting
Backlight=internalCmds
# Turn on display and make fully bright. But 0x0c would be enough
BacklightCmdOn=0x0c17
# Turn off display
BacklightCmdOff=0x08
# These are standard commands used when Backlight = internal
#BacklightCmdOn=0x17
#BacklightCmdOff=0x13
# EOF Everything works as I expected:
Except commands I provided - they were wrong, according to spec it should be And make sure Greets |
Hi Michal,
So internal OFF is not working (maybe because it uses 13 instead of 08), but i can use internalCmds and reach my goal. Thank you very mutch Edit: So 8 bits for ON are:00001100 -> 0x08 Spec only detail full ON and full OFF, so how did you get DIMMING? |
Hi
Yes, this is how I imagined to achieve fully off screen. Internal only works for Winstar WS0010 OLED controller like described in spec, which has brightness control (2 levels) using special commands 0x17 and 0x13. Here are some examples of these: 20x2 OLED display and here or 16x2 OLED display. According to your description it looks like your display is regular LCD one with black surface and dots highlighted by external LED (like for example here), possibly this is the reason only You can combine two methods of backlight control though, using two options [hd44780]
# The first one just controls BL pin
Backlight = external
# The second one turns on and off display
Backlight = internalCmds
BacklightCmdOn=0x0c
BacklightCmdOff=0x08 Greets, Michał |
Hi Michal no, i have a winstar WEH002004AWPP5N00005, a 20x4 Oled with WS0010 as reported by spec. I understood that capability involved in backlight are (from spec):
This is possible by setting:
This is possible by setting: Maybe we have a different pcb and firmware revision and my display has not that feature (internal power, not well documented in spec). Trying to investigate further. |
Hi, i have an 20x4 Winstar OLED screen (HD44780 compatible, i2c wired with backpack), and it works perfect with latest DEV build.
I can also DIM screen using external backlight settings in LCDd.conf, so i can change from full bright to dim bright.
The problem is that now i need to implement a toggle to completely turn bright off and on, without the needs to clear screen. Is this possible?
I tryed to set OffBrightness to 0 in LCDd.conf but it doesn't seem to work.
Thank you
Emanuele
The text was updated successfully, but these errors were encountered: