PiTFT backlight control not working and LCD question

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
wire
 
Posts: 6
Joined: Sun Mar 30, 2014 2:45 pm

PiTFT backlight control not working and LCD question

Post by wire »

Did a standard install of the latest version of Raspbian (2014-01-07 with 3.10 kernel) and following the PiTFT install instructions here:
https://learn.adafruit.com/adafruit-pit ... stallation

Everything works except the backlight control. when I try and run

Code: Select all

sudo sh -c "echo 252 > /sys/class/gpio/export"
 ls -l /sys/class/gpio
I only get the following:

Code: Select all

pi@raspberrypi:~$ ls -l /sys/class/gpio
total 0
-rwxrwx--- 1 root gpio 4096 Apr  7 00:28 export
lrwxrwxrwx 1 root gpio    0 Jan  1  1970 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
-rwxrwx--- 1 root gpio 4096 Jan  1  1970 unexport
pi@raspberrypi:~$
For some reason the 252 GPIO is not getting exported properly. Any idea what I missed or how to fix this?

Working on a battery operated pi project so need the ability to shut the back light off when not in use.

Second question is about the LCD itself. Is there a data sheet available for it? If not does anyone have the electrical details on the LEDs and their arrangement used for the back light? Looking at the logic they are the only devices powered by 5V. I am in the process of laying out a switching regulator card to replace the three linear regs on the Pi. (again for power savings) As part of that process I want to switch to a switching reg to power the back light but need the LED info to select the best one.

Thanks,

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: PiTFT backlight control not working and LCD question

Post by adafruit2 »

There might be a bug in the latest kernel - will send this as a bug report to the code writer :) you can try installing the non-DMA kernel in the meantime

datasheets here
https://learn.adafruit.com/adafruit-pit ... /downloads

User avatar
wire
 
Posts: 6
Joined: Sun Mar 30, 2014 2:45 pm

Re: PiTFT backlight control not working and LCD question

Post by wire »

Got the datasheet that was what I needed thanks!

On the back light control I ran the following commands to back out the DMA kernel

Code: Select all

wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-112613.deb
sudo dpkg -i -B *.deb
sudo reboot
 sudo sh -c "echo 252 > /sys/class/gpio/export"
ls -l /sys/class/gpio
and I got the same results as above. Looks like the issue is DMA independent. Wonder if something else change in the Raspbian base load that broke this function. Just not sure where to start to debug this issue.

Thanks,

User avatar
notro
 
Posts: 93
Joined: Tue Sep 11, 2012 9:59 am

Re: PiTFT backlight control not working and LCD question

Post by notro »

Do you have this in the kernel log?

Code: Select all

$ dmesg
[ 14.559719] gpiochip_find_base: cannot find free range
[ 14.573771] gpiochip_add: gpios -1..4 (stmpe) failed to register
[ 14.581470] stmpe-gpio stmpe-gpio.0: unable to add gpiochip: -28
[ 14.598216] stmpe-gpio: probe of stmpe-gpio.0 failed with error -28
If so, that kernel hasn't been patched to handle extra gpio chips. Currently the Pi kernel doesn't have room for extra GPIO chips.


This is how it looks when the stmpe-gpio driver is loaded:

Code: Select all

$ ls -l /sys/class/gpio/
total 0
-rwxrwx--- 1 root gpio 4096 Jan  1  1970 export
lrwxrwxrwx 1 root gpio    0 Jan  1  1970 gpiochip0 -> ../../devices/virtual/gpio/gpiochip0
lrwxrwxrwx 1 root gpio    0 Apr  8 13:44 gpiochip250 -> ../../devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/stmpe-gpio.0/gpio/gpiochip250
-rwxrwx--- 1 root gpio 4096 Jan  1  1970 unexport

User avatar
wire
 
Posts: 6
Joined: Sun Mar 30, 2014 2:45 pm

Re: PiTFT backlight control not working and LCD question

Post by wire »

Yep that is the exact error I am getting.
Do you happen to know what patch I need to install to get that added GPIO function to work?

Thanks again,

User avatar
notro
 
Posts: 93
Joined: Tue Sep 11, 2012 9:59 am

Re: PiTFT backlight control not working and LCD question

Post by notro »

You have to rebuild the kernel to get it working.
I use this patch: https://github.com/notro/rpi-build/blob ... hips.patch

Other options while waiting for a Adafruit fix:
* try the kernel I use: https://github.com/notro/fbtft/issues/8 ... t-36920153
* try an image which uses that kernel: viewtopic.php?f=50&t=51468

User avatar
wire
 
Posts: 6
Joined: Sun Mar 30, 2014 2:45 pm

Re: PiTFT backlight control not working and LCD question

Post by wire »

Thanks much I will give that a try when I get home.

User avatar
wrightw
 
Posts: 1
Joined: Wed May 21, 2014 7:50 am

Re: PiTFT backlight control not working and LCD question

Post by wrightw »

I'm curious... did this patch work? I have the same problem. I'm enough of a Linux novice that if the patch messes something up, I'll have no idea what to do next! Thanks...

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”