Page 1 of 2

backlight control

Posted: Sat Jul 04, 2009 9:42 pm
by nicolas
Anyone know how to control the backlight via software ?

The power settings dont seem to kick in, so the backlight doesnt turn off after X minutes.

Re: backlight control

Posted: Thu Jul 30, 2009 7:24 pm
by valentinfr
i have the same probleme....

Re: backlight control

Posted: Sun Aug 30, 2009 9:26 pm
by Harborseal
There is sample back light control in the Linux test routines. Also, the "No-OS" test routines are best since they don't use drivers and you can see what bits to twiddle.

Re: backlight control

Posted: Mon Sep 07, 2009 10:01 am
by nicolas
I stumbled upon an answer...

"The LED backlight can be turned on or off or modulated with GPB1. The
backlight signal is called LCD_PWR PWM output (GPB1 be sent through Depositors configuration for
PWM"
- http://andahammer.com/assets/Uploads/Al ... ntials.pdf

Now I need to figure out how to control the GPIO from WinCE in a simple way.

Re: backlight control

Posted: Fri Sep 11, 2009 12:57 am
by nicolas
Well for whatever reason controlling GPIOB1 doesnt do anything to the backlight.
Must be based on a different design - the document, or due to WinCE's backlight driver overidding what Im setting (even thought a read-back shows the new value)

Anyways...
I did finally figure it out. (Much reading of the S3C2440 datasheet and maney code tries later)

-----
Setup:
Disable pull up on the GPIOG4 pin
Set the GPIOG4 to LCD_PWREN mode
Set the PWREN bit of the LCDCON5 register.

Use:
To control the LCD and thus the backlight, Toggle the ENVID bit of LCDCON1
-----


Info..
Since the LCD is being driven via the S3C2440's LCD driver the backlight appears to be as well.
The PWREN bit is used by the processor to control the LCD_PWREN signal. ("LCD_PWREN output signal enable/disable.")
Reading back in the datasheet, you will find that the LCD_PWREN signal can be controlled by the ENVID bit (which controls the video output/logic); unfortunatly the display is not initialized with the registers set to make use of the LCD_PWREN signal.
So you need to set the GPIOG4 pin to the proper mode, then set the PWREN bit, then the lcd logic and backlight can be controlled via the ENVID bit.

backlight control

Posted: Fri Oct 09, 2009 3:07 am
by imallulky
It agree, it is an excellent idea

Re: backlight control

Posted: Fri Oct 09, 2009 4:46 am
by armboarder
So is the "last" update of WinCE image fix this control mecanisms ? How could you do that under WinCE ? Should the backlight driver be modified?

Re: backlight control

Posted: Fri Oct 09, 2009 8:09 am
by nicolas
The backlight/lcd driver could be modified to perform the 'setup' steps.
But thats not needed, you can do it in software.

By writing to the registers you can make it do that. How ?
YOu can use the CFIO.dll (PhysicalAddressPointer) I posted earlier in the WinCE Sample LED's to access the registers.

I will be releasing an updated S3C2440 class and accompaniying Mini2440 class (from the above sample noted) that includes the backlight stuff in the next few days. Just need to test a couple things.

Re: backlight control

Posted: Thu Oct 15, 2009 7:40 am
by armboarder
I'm writing in C language.
To be able to access Physical register I need to write a piece of code that is in kernel, isn't it ? I can't access these in my WinCE application ?
What does it takes to modify the driver to work properly ?
Should I proceed this way :
- Adding 3 lines of C code,
- Compiling the driver with ADS
- Recompiling WinCE with Platform builder.

Re: backlight control

Posted: Thu Oct 15, 2009 7:53 am
by nicolas
Since C is not managed code, it should be very easy to access the registers directly.
Im not sure how, but you should be able too.

The registers are memory mapped, possibly simply making a pointer to the memory and writing/reading to it may do the trick (thats what the C# physicaladdresspointer class does but within managed code)

There is no real need to modify the backlight driver, as you can do the initialization within user code.