bluecat
Posts: 1
Joined: Thu Jun 23, 2016 6:19 pm

Windows IOT and Display Backlight Brightness

Fri Jun 24, 2016 5:21 am

I am looking for a possibility to set the backlight-brightness (0-100%) of the original raspberry-display V1.1 under Windows 10 IOT.

Setting the backlight under raspbian works, so the Hardware seems to be ready for it.

I use Visual Studio 15 - C# for developement.

I couldn't find anything on this Topic on the web and now I am looking for the commands.

Please help

Monigass
Posts: 1
Joined: Mon Jul 11, 2016 6:44 pm

Re: Windows IOT and Display Backlight Brightness

Mon Jul 11, 2016 6:52 pm

I found you can modify the backlight with the I2C registers :

{DISPLAY_ADDR, BACKLIGHT_REG_ADDR, BRIGHTNESS}

DISPLAY_ADDR = 0x45;
BACKLIGHT_REG_ADDR = 0x86;
BRIGHTNESS = (0 - 255)

using the pins from de display board, but sometimes the touch stops working :( working

dan.inden
Posts: 2
Joined: Tue Oct 18, 2016 8:02 pm

Re: Windows IOT and Display Backlight Brightness

Tue Oct 18, 2016 8:03 pm

I can confirm that this works:

string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
IReadOnlyList<DeviceInformation> devices = await DeviceInformation.FindAllAsync(i2cDeviceSelector);

var settings = new I2cConnectionSettings(0x45);

var screen = await I2cDevice.FromIdAsync(devices[0].Id, settings);

byte[] writeBuff = new byte[] { 0x86, 0x80 };
screen.Write(writeBuff);

mibue
Posts: 1
Joined: Wed Nov 23, 2016 6:56 pm

Re: Windows IOT and Display Backlight Brightness

Wed Nov 23, 2016 7:09 pm

dan.inden wrote:I can confirm that this works:

string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
IReadOnlyList<DeviceInformation> devices = await DeviceInformation.FindAllAsync(i2cDeviceSelector);

var settings = new I2cConnectionSettings(0x45);

var screen = await I2cDevice.FromIdAsync(devices[0].Id, settings);

byte[] writeBuff = new byte[] { 0x86, 0x80 };
screen.Write(writeBuff);
Hi dan.inden

is there any Documentation to this "Feature" ? What bytes i have to write?
My Problem i want to use my pi for homeautomation and after a definied time i want to Switch the brightness to 0 or turn off the backlight. If i touch the Display i want to turn on the Backlight or Brightness to 100%.
Is there any Documented Solution or can you help me please?

Thanks by Michael

PlayersZ28
Posts: 3
Joined: Mon Nov 14, 2016 3:06 pm

Re: Windows IOT and Display Backlight Brightness

Fri Dec 02, 2016 2:07 am

I turn off the backlight with hardware as I couldn't find a workable s/w solution.

dan.inden
Posts: 2
Joined: Tue Oct 18, 2016 8:02 pm

Re: Windows IOT and Display Backlight Brightness

Mon Dec 05, 2016 3:17 pm

There is no documentation.
The code I provided changes the brightness to 0x80.
Writing 0x00 will turn the display off.

I also use this in my homeautomation solution, but it's not 100% stable and the touchscreen often doesn't respond anymore after changing brightness (mostly it starts responding again after some time).
I trigger turning on and off based on the input of a PIR sensor, and use the time of the day to determine the brightness. So I don't need the touchscreen support.
Still its not 100% stable.

alexanderofyork
Posts: 1
Joined: Wed Dec 14, 2016 12:41 am

Re: Windows IOT and Display Backlight Brightness

Wed Dec 14, 2016 12:50 am

Besides that it seems every I2c answer presumes I am using the bus for only one item, I don't understand what I should be getting back from I2cDevice.GetDeviceSelector(). This is what I get...

"System.Devices.InterfaceClassGuid:=\"{A11EE3C6-8421-4202-A3E7-B91FF90188E4}\" AND System.Devices.InterfaceEnabled:=System.StructuredQueryType.Boolean#True"

Understandably when I use that string to await DeviceInformation.FindAllAsync(i2cDeviceSelector);
I "await" forever.

wedge
Posts: 2
Joined: Fri Dec 30, 2016 7:05 am

Re: Windows IOT and Display Backlight Brightness

Fri Dec 30, 2016 7:08 am

dan.inden wrote:I can confirm that this works:

I've tried that code, and I get the error: "The system cannot find the file specified. Slave address was not acknowledged."

What am I missing here?

skipfire
Posts: 28
Joined: Fri Dec 30, 2016 1:27 pm
Location: Indiana, USA

Re: Windows IOT and Display Backlight Brightness

Fri Dec 30, 2016 1:37 pm

I also get that the slave address was not acknowledged. I'm using a Raspberry Pi 3 with just the display ribbon connecting the display and USB power to both Pi & display. My guess is that solution requires that you connect to the SDA and clock pins as well.

I also would guess that the reason the touch screen stops responding is that you are interfering with the OS's communication by writing, but that it has a level of fault recovery and eventually resets it's I2C connection with the touchscreen.

wedge
Posts: 2
Joined: Fri Dec 30, 2016 7:05 am

Re: Windows IOT and Display Backlight Brightness

Fri Dec 30, 2016 4:04 pm

Yup, I figured it out, that's the solution.
skipfire wrote: My guess is that solution requires that you connect to the SDA and clock pins as well.
I had previously assumed there was an I2C connection through the DSI port, but apparently not. At least not the same I2C port we can access through software.

skipfire
Posts: 28
Joined: Fri Dec 30, 2016 1:27 pm
Location: Indiana, USA

Re: Windows IOT and Display Backlight Brightness

Fri Dec 30, 2016 5:25 pm

I believe there is one in the DSI port, it may simply be an addressing issue, or perhaps Windows IoT has it locked and is hiding it.

xbened02
Posts: 1
Joined: Mon Jan 23, 2017 8:03 pm

Re: Windows IOT and Display Backlight Brightness

Mon Jan 23, 2017 8:10 pm

I am using this solution and it is working great without any problem

private static I2cDevice I2CAccel;

public static void Initialize()
{
InitI2C();
}

public static async void InitI2C()
{
int i = int.Parse(value.ToString());
string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
var settings = new I2cConnectionSettings(0x45);
IReadOnlyList<DeviceInformation> devices = await DeviceInformation.FindAllAsync(i2cDeviceSelector);
var screen = await I2cDevice.FromIdAsync(devices[0].Id, settings);
I2CAccel = screen;


byte[] writeBuff = new byte[] { 0x86, (byte)(55) }; //backlight address, brightness 0-255

/* Write the register settings */
try
{
I2CAccel.Write(writeBuff);
}
catch (Exception ex)
{
return;
}

}

then write function

byte[] writeBuff = new byte[] { 0x86, (byte)(80) }; //backlight address, brightness 0-255
I2CAccel.Write(writeBuff);

skipfire
Posts: 28
Joined: Fri Dec 30, 2016 1:27 pm
Location: Indiana, USA

Re: Windows IOT and Display Backlight Brightness

Wed Jan 25, 2017 10:18 pm

That does not work for me. "Slave address was not acknowledged."

1) Are you on a Pi 2 or Pi 3?

2) Are you using just the ribbon to connect, or are you using the pins as well?

I'm hoping we might be able to pick out why it works for some people and not others. I am on a Pi 3 using just the ribbon cable. I have tried this on a couple of Pi's so it is not a problem with just one Pi.

cyberh0me
Posts: 1
Joined: Thu Mar 16, 2017 8:32 pm

Re: Windows IOT and Display Backlight Brightness

Thu Mar 16, 2017 8:40 pm

All display rendering is done by VC4 firmware (GPU microcode managed by Pi Foundation).
The I2c channel between LCD panel and VC4 is not exposed to Windows, because VC4 takes full ownership of that I2c channel. The I2c pins are internally connected to VC4 and touch controller - that’s how touch controller works and it uses those heavily. So you could be introducing issues with touch!

brianbaero
Posts: 1
Joined: Fri Apr 14, 2017 8:17 am

Re: Windows IOT and Display Backlight Brightness

Fri Apr 14, 2017 8:23 am

The code posted worked for me. Using Pi 3 B v1.2, Win10 IoT build 15063. Connected I2C pins from the display board to the Pi.

Aberlon
Posts: 2
Joined: Sat Jan 06, 2018 7:11 pm

Re: Windows IOT and Display Backlight Brightness

Sat Jan 06, 2018 7:57 pm

xbened02 wrote: I am using this solution and it is working great without any problem

private static I2cDevice I2CAccel;

public static void Initialize()
{
InitI2C();
}

public static async void InitI2C()
{
int i = int.Parse(value.ToString());
string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
var settings = new I2cConnectionSettings(0x45);
IReadOnlyList<DeviceInformation> devices = await DeviceInformation.FindAllAsync(i2cDeviceSelector);
var screen = await I2cDevice.FromIdAsync(devices[0].Id, settings);
I2CAccel = screen;


byte[] writeBuff = new byte[] { 0x86, (byte)(55) }; //backlight address, brightness 0-255

/* Write the register settings */
try
{
I2CAccel.Write(writeBuff);
}
catch (Exception ex)
{
return;
}

}

then write function

byte[] writeBuff = new byte[] { 0x86, (byte)(80) }; //backlight address, brightness 0-255
I2CAccel.Write(writeBuff);
Sadly I think this solution will only work if you use the I2C only for adjusting the brightness. As i'm using the i2c for some sensors an amplifier and a TEA5767 it generates a lot of exeptions and ends up with a non working touch.

I also failed to find a solution with using the BrightnessOverride Class... (It's not supported).
So i think cyberh0me is right and there is no (good) way to adjust the brightness with the IoT Core and UWP Apps.

ianst
Posts: 2
Joined: Mon Feb 19, 2018 3:50 pm

Re: Windows IOT and Display Backlight Brightness

Mon Feb 19, 2018 3:52 pm

Any update?
This one is critical for my project, but using i2c is too unstable. Trying to fade in/out and there tons of artifacts appears. :cry:

mrsteveman1
Posts: 1
Joined: Sat Feb 24, 2018 5:15 am

Re: Windows IOT and Display Backlight Brightness

Sat Feb 24, 2018 6:07 am

ianst wrote:
Mon Feb 19, 2018 3:52 pm
Any update?
This one is critical for my project, but using i2c is too unstable. Trying to fade in/out and there tons of artifacts appears. :cry:
I've been working on this a bit tonight, the real solution is to do what the Linux kernel does: ask the GPU (AKA the "real" CPU :lol:) to adjust the brightness, rather than trying to do it directly as that is always going to cause problems.

As I recall, the GPU has a "mailbox" interface for this that shouldn't be too complicated to use, and it looks like Microsoft has already added support for the VC4 mailbox to the BSP, however they haven't added the back light related properties yet.

Doesn't look too complicated, so if nobody else has done it already and stuffed the changes in a branch or PR somewhere on Github, I'll take a look soon.

ianst
Posts: 2
Joined: Mon Feb 19, 2018 3:50 pm

Re: Windows IOT and Display Backlight Brightness

Tue Mar 27, 2018 6:34 am

mrsteveman1 wrote:
Sat Feb 24, 2018 6:07 am
Doesn't look too complicated, so if nobody else has done it already and stuffed the changes in a branch or PR somewhere on Github, I'll take a look soon.
Oh please make it))
The only reason am making project on linux is screen brightness, but i hate linux :)

Aberlon
Posts: 2
Joined: Sat Jan 06, 2018 7:11 pm

Re: Windows IOT and Display Backlight Brightness

Tue Jul 17, 2018 11:08 pm

mrsteveman1 wrote: As I recall, the GPU has a "mailbox" interface for this that shouldn't be too complicated to use, and it looks like Microsoft has already added support for the VC4 mailbox to the BSP, however they haven't added the back light related properties yet.

Sadly we can`t access a driver from a UWP app so using the rpiq mailbox driver doesn`t work.

With my little hobbyists knowledge i tried to write my own mailbox interface and failed again. ;)

<sarcasm>
It seems that we can`t allocate contiguous memory for the message structure and write it's pointer to a protected memory address :)
</sarcasm>

well i give up now with controlling the display backlight and get me some glass of b**r - cheers :)

ababuy
Posts: 1
Joined: Fri Dec 07, 2018 10:57 am

Re: Windows IOT and Display Backlight Brightness

Fri Dec 07, 2018 11:09 am

Hello all,

Any news regarding this feature?

I have tried the I2C write method and even though it works for a while, I am getting two errors form time to time:
Error 1: The request could not be performed because of an I/O device error. Unexpected number of bytes was transferred. Expected: '. Actual: '.
and after a while,
Error 2: The system cannot find the file specified. Slave address was not acknowledged.

Does anyone knows what these means?

Return to “Windows 10 for IoT”