Respectech
Posts: 53
Joined: Sat Sep 29, 2012 12:27 am

Alternate 7" LCD touchscreen on Pi

Wed Dec 16, 2015 9:55 pm

I'm trying to use a 7" LCD touchscreen (that I already own) with the RPi2. The LCD is powered through a microUSB cable which also transmits the touchscreen coordinates back through the cable, and has a full-sized HDMI port.

Here's the setup:
* RPi2 with the latest version of Raspbian with all updates
* Desktop Power Supply @ 5.0VDC -> USB to microUSB cable -> RPi2 microUSB port = RPi2 boots up fine
* RPi2 USB port -> USB to microUSB cable -> LCD microUSB port = LCD seems to have a power stability issue
* RPi2 HDMI port -> LCD HDMI port = LCD displays fine when USB power input to LCD is stable (like from an external power supply)

When powering up the RPi2, the LCD turns on and off in a repeating manner. However, if I power it from another USB power supply, the screen works fine and stays powered on properly. This, however, negates the possibility of getting feedback from the touchscreen through the USB port. I tried increasing the voltage on the power supply to 5.25VDC with no improvement. I have not yet tried using a powered USB hub on the RPi2 (I don't have one handy).

The other interesting problem is that the RPi2 seems to only display 640x480 and leaves the right-side 160x480 pixels off. I've tried numerous options in the /boot/config.txt file, but have the same problem.

Any ideas?

An interesting thing to note is that the RPi2 seems to be able to downscale resolutions all the way up to 1920x1080 to fit on the LCD. However, at this point it is scaling those resolutions to fit in the leftmost 640 pixels.

User avatar
mikronauts
Posts: 2739
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Alternate 7" LCD touchscreen on Pi

Wed Dec 16, 2015 10:38 pm

in /boot/config.txt add

usb_max_curent=1

Your LCD is not getting enough power

The best scaled resolution to use for an 800x480 screen would be 1600x960, see

http://www.mikronauts.com/raspberry-pi/ ... periments/

for an explanation, and sample shot
Respectech wrote:I'm trying to use a 7" LCD touchscreen (that I already own) with the RPi2. The LCD is powered through a microUSB cable which also transmits the touchscreen coordinates back through the cable, and has a full-sized HDMI port.

Here's the setup:
* RPi2 with the latest version of Raspbian with all updates
* Desktop Power Supply @ 5.0VDC -> USB to microUSB cable -> RPi2 microUSB port = RPi2 boots up fine
* RPi2 USB port -> USB to microUSB cable -> LCD microUSB port = LCD seems to have a power stability issue
* RPi2 HDMI port -> LCD HDMI port = LCD displays fine when USB power input to LCD is stable (like from an external power supply)

When powering up the RPi2, the LCD turns on and off in a repeating manner. However, if I power it from another USB power supply, the screen works fine and stays powered on properly. This, however, negates the possibility of getting feedback from the touchscreen through the USB port. I tried increasing the voltage on the power supply to 5.25VDC with no improvement. I have not yet tried using a powered USB hub on the RPi2 (I don't have one handy).

The other interesting problem is that the RPi2 seems to only display 640x480 and leaves the right-side 160x480 pixels off. I've tried numerous options in the /boot/config.txt file, but have the same problem.

Any ideas?

An interesting thing to note is that the RPi2 seems to be able to downscale resolutions all the way up to 1920x1080 to fit on the LCD. However, at this point it is scaling those resolutions to fit in the leftmost 640 pixels.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Respectech
Posts: 53
Joined: Sat Sep 29, 2012 12:27 am

Re: Alternate 7" LCD touchscreen on Pi

Wed Dec 16, 2015 11:45 pm

Thanks for your reply!

I added the usb_max_current=1 line, and it almost worked. I could see the boot process about half the time (interspersed with the screen flashing garbage pixels), but when it got to the desktop, it was all garbage pixels.

I also tried changing the resolution to 1600x960, but it still had the dead area on the right side of the display. See the attached image (powered from a separate USB power supply).

I think it would probably work with a powered USB hub, but the ignored 160 pixels on the right side seems to be the biggest problem for me right now.

Respectech
Posts: 53
Joined: Sat Sep 29, 2012 12:27 am

Re: Alternate 7" LCD touchscreen on Pi

Wed Dec 16, 2015 11:52 pm

Here's the picture of the display (sorry for the flash). As you can see, the aspect ratio is correct, but it is scaled as if the screen was only 640 pixels wide instead of 800 pixels wide.
Attachments
800x480RPi2.jpg
800x480RPi2.jpg (63.13 KiB) Viewed 3455 times

User avatar
mikronauts
Posts: 2739
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Alternate 7" LCD touchscreen on Pi

Thu Dec 17, 2015 12:18 am

You are welcome.

Sometimes I cheat when powering devices :)

In this case, I'd open up the USB cable, and disconnect the 5V line from the Pi, and power it separately.

Regarding the missing 160 pixels:

- perhaps the EDID from the HDMI/LCD adapter board is reporting 640x480?
- perhaps the horizontal sync period is too long?
- did you turn off overscan in rpi.config?

I've had similar issues with some third party hdmi adapter boards, it is usually fixable by changing display parameters.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Respectech
Posts: 53
Joined: Sat Sep 29, 2012 12:27 am

Re: Alternate 7" LCD touchscreen on Pi

Thu Dec 17, 2015 12:42 am

I got it working at (close to) the native resolution! Here are the important lines from config.txt:

#disable_overscan=1
overscan_right=48
hdmi_ignore_edid=0xa5000080
hdmi_group=2
hdmi_mode=14
hdmi_drive=1

I believe hdmi_mode 14 is 848x480, and I actually wanted 800x480, so I set overscan_right to 48 to compensate.

It works beautifully. Thanks for your help, mikronauts!

User avatar
mikronauts
Posts: 2739
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Alternate 7" LCD touchscreen on Pi

Thu Dec 17, 2015 1:22 am

You are most welcome!
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Respectech
Posts: 53
Joined: Sat Sep 29, 2012 12:27 am

Re: Alternate 7" LCD touchscreen on Pi

Thu Dec 17, 2015 5:49 am

The next challenge is getting the touchscreen driver to work. I built a USB cable that goes between the Raspberry Pi 2 and the LCD, but has two extra leads (5V and ground) that connect to pins on the 2x20 header. That took care of the power issue.

A compatible driver according to the screen's hardware ID is here: https://github.com/derekhe/waveshare-7i ... een-driver

But I still couldn't get the touchscreen to work after installing that.

User avatar
mikronauts
Posts: 2739
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Alternate 7" LCD touchscreen on Pi

Thu Dec 17, 2015 4:43 pm

Google for that touch controller chip & raspberry pi, and perhaps enter an issue on that github.

Keep us updated how it goes!
Respectech wrote:The next challenge is getting the touchscreen driver to work. I built a USB cable that goes between the Raspberry Pi 2 and the LCD, but has two extra leads (5V and ground) that connect to pins on the 2x20 header. That took care of the power issue.

A compatible driver according to the screen's hardware ID is here: https://github.com/derekhe/waveshare-7i ... een-driver

But I still couldn't get the touchscreen to work after installing that.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

Return to “Other projects”