gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

LCD Touch rotate issue on ADS7846 for Jessie Lite with RPi0

Sun Jan 22, 2017 4:54 pm

Hello!
For better performance I have to use Jessie Lite with RPi Zero but I also need a Touch LCD attached.
The LCD is working fine with the correct rotation but the touch functionality is rotated 90' counterclockwise, so if I slide my finger UP pointer slides LEFT. I have tried too many methods, none worked, so I am posting for your help.
FYI, It is for an open source smart thermostat we develop for some time, HestiaPi (http://www.hestiapi.com).

Here is what I have done after update&upgrade on latest Jessie Lite

Code: Select all

sudo apt-get install --no-install-recommends xserver-xorg xinit xserver-xorg-video-fbdev lxde lxde-common lightdm
sudo apt-get install git build-essential xorg-dev xutils-dev x11proto-dri2-dev libltdl-dev libtool automake libdrm-dev
git clone https://github.com/ssvb/xf86-video-fbturbo.git
cd xf86-video-fbturbo
autoreconf -vi
./configure --prefix=/usr
make
sudo make install
add code in /usr/share/X11/xorg.conf.d/99-fbturbo.conf

Code: Select all

Section "Device"
        Identifier      "Allwinner A10/A13 FBDEV"
        Driver          "fbturbo"
        Option          "fbdev" "/dev/fb1"

        Option          "SwapbuffersWait" "true"
EndSection

sudo reboot

sudo apt-get install policykit-1 hal
sudo reboot

wget http://www.hestiapi.com/LCD-show.tar.gz
tar xvf LCD-show.tar.gz
cd LCD-show/
sudo ./LCD35-show
The display is a Waveshare 3.5" and the above command is a copy of the drivers from waveshare. Their server was too slow sometimes, so I copied it in our server. Here is some more info:

Code: Select all

[email protected]:~ $ lsmod
Module                  Size  Used by
fb_ili9486              3213  2
fbtft                  32615  1 fb_ili9486
syscopyarea             3161  1 fbtft
sysfillrect             3716  1 fbtft
sysimgblt               2422  1 fbtft
fb_sys_fops             1677  1 fbtft
ads7846                12525  0
hwmon                   4552  1 ads7846
r8188eu               454315  0
joydev                  9194  0
evdev                  11650  6
cfg80211              500089  1 r8188eu
rfkill                 21397  2 cfg80211
i2c_bcm2708             5740  0
spi_bcm2835             7424  0
bcm2835_gpiomem         3823  0
bcm2835_wdt             4133  0
w1_gpio                 4534  0
wire                   31801  1 w1_gpio
cn                      5860  1 wire
uio_pdrv_genirq         3718  0
uio                    10230  1 uio_pdrv_genirq
ipv6                  367671  34

Code: Select all

[email protected]:~ $ dmesg | grep spi
[   17.179026] ads7846 spi0.1: touchscreen, irq 177
[   17.191827] input: ADS7846 Touchscreen as /devices/platform/soc/20204000.spi/spi_master/spi0/spi0.1/input/input2
[   18.738973] graphics fb1: fb_ili9486 frame buffer, 480x320, 300 KiB video memory, 4 KiB DMA buffer memory, fps=33, spi0.0 at 16 MHz
Shout if you see something wrong, please.

User avatar
davidcoton
Posts: 4212
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: LCD Touch rotate issue on ADS7846 for Jessie Lite with R

Sun Jan 22, 2017 5:26 pm

This topic may help.
Signature retired

gulliverrr
Posts: 38
Joined: Wed Jan 02, 2013 1:38 pm

Re: LCD Touch rotate issue on ADS7846 for Jessie Lite with R

Sun Jan 22, 2017 9:37 pm

Thanks davidcoton!
Kinda did. Slightly different screen/driver but same fix, works here too! I posted there my changes for anyone interested in ADS7846.

Return to “Troubleshooting”