backlight control

nicolas
Posts: 162
Joined: Sun Jun 07, 2009 4:32 pm

backlight control

Post by nicolas » Sat Jul 04, 2009 9:42 pm

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.

valentinfr
Posts: 8
Joined: Fri Jul 17, 2009 6:24 am

Re: backlight control

Post by valentinfr » Thu Jul 30, 2009 7:24 pm

i have the same probleme....

Harborseal
Posts: 9
Joined: Wed Apr 22, 2009 1:23 am
Location: USA
Contact:

Re: backlight control

Post by Harborseal » Sun Aug 30, 2009 9:26 pm

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.

nicolas
Posts: 162
Joined: Sun Jun 07, 2009 4:32 pm

Re: backlight control

Post by nicolas » Mon Sep 07, 2009 10:01 am

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.

nicolas
Posts: 162
Joined: Sun Jun 07, 2009 4:32 pm

Re: backlight control

Post by nicolas » Fri Sep 11, 2009 12:57 am

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.

imallulky
Posts: 1
Joined: Fri Oct 09, 2009 2:57 am
Location: England
Contact:

backlight control

Post by imallulky » Fri Oct 09, 2009 3:07 am

It agree, it is an excellent idea

armboarder
Posts: 15
Joined: Thu Aug 27, 2009 12:45 pm

Re: backlight control

Post by armboarder » Fri Oct 09, 2009 4:46 am

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?

nicolas
Posts: 162
Joined: Sun Jun 07, 2009 4:32 pm

Re: backlight control

Post by nicolas » Fri Oct 09, 2009 8:09 am

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.

armboarder
Posts: 15
Joined: Thu Aug 27, 2009 12:45 pm

Re: backlight control

Post by armboarder » Thu Oct 15, 2009 7:40 am

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.

nicolas
Posts: 162
Joined: Sun Jun 07, 2009 4:32 pm

Re: backlight control

Post by nicolas » Thu Oct 15, 2009 7:53 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests