DRAgon715205
Posts: 61
Joined: Wed Apr 02, 2014 11:46 am

Raspbian 2017-03-02 bug fbtft touch calibrate X/Y Inverted

Tue Mar 07, 2017 10:16 am

The lastest raspbian OS have updated to 2017-03-02-raspbian-jessie
But I have some questiones at fbtft Device Tree (fbtft old driver can display ok but touch Inverted )
my LCD with touch chip xpt2046

1 The calibration file “/etc/X11/xorg.conf.d/99-calibration.conf” is not working Now.
if you change any parameters of 99-calibration.conf ,Nothing will happen

2. The xinput-calibrate software APP will not work well .
If you calibrate ,you will get the following very big number
(MaxX and MaxY are so big ,the old number at old raspbian is {Option "Calibration" "3932 300 294 3801"} and work well)
----------------------------------------------------------------------------------------------
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "MinX" "159"
Option "MaxX" "65512"
Option "MinY" "102"
Option "MaxY" "65637"
Option "SwapXY" "0" # unless it was already set to 1
Option "InvertX" "0" # unless it was already set
Option "InvertY" "0" # unless it was already set
EndSection
---------------------------------------------------------------------------------------------

3. The touch parameters “xmin ymin xmax ymax” of dtoverlay=ads7846 or fbtft Device Tree can not be set
and if you change the 4 parameters , they will change nothing and keep the default setting

I have removed the file “/etc/X11/xorg.conf.d/99-calibration.conf” and Add Device Tree ads7846 to /boot/config.txt
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dtoverlay=ads7846,cs=1,penirq=17,penirq_pull=2,speed=1000000,keep_vref_on=1,swapxy=1,pmax=255,xohms=60,xmin=200,xmax=3900,ymin=200,ymax=3900
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Then the touch go to X Inverted and I change "xmin=200,xmax=3900 " to "xmin=3900,xmax=200" but nothing happened

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2945
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Raspbian 2017-03-02 bug fbtft touch calibrate X/Y Invert

Tue Mar 07, 2017 10:20 am

This isn't a DT problem (DT is only the medium for configuring the display), so the topic has been moved to a more appropriate forum.

DRAgon715205
Posts: 61
Joined: Wed Apr 02, 2014 11:46 am

Re: Raspbian 2017-03-02 bug fbtft touch calibrate X/Y Invert

Tue Mar 07, 2017 10:50 am

I have understand why It become that

The following is coming from swkim01
-------------------------------------------------------------------------------------------------------
That is because now x server uses libinput to handle input devices instead of evdev.

As to coordination transformation matrix, you have to add the following code within the section of touchscreen in 99-callibration.conf
in case of inverting x,
Option "TransformationMatrix" "-1 0 1 0 1 0 0 0 1"
in case of inverting y,
Option "TransformationMatrix" "1 0 0 0 -1 1 0 0 1"
in case of swapping x and y,
Option "TransformationMatrix" "0 1 0 1 0 0 0 0 1"
, etc...

You can confirm the properties of the input device by following commands.

$ xinput list
$ xinput list-props "ADS7846 Touchscreen"
----------------------------------------------------------------------------------------------------

But Now the big question is how we can calibrate the touchscreen??

Becasue of the question 2, I can not get the right calibration number
Becasue of the question 1 and 3 , if I can get the right calibration number , I also do know how to make them work

distrom
Posts: 1
Joined: Wed Mar 15, 2017 10:17 am

Re: Raspbian 2017-03-02 bug fbtft touch calibrate X/Y Invert

Wed Mar 15, 2017 10:24 am

Calibration for my 3.5" touchscreen:
Option "TransformationMatrix" "0 1.128 -0.08 -1.13 0 1.07 0 0 1"

Return to “Interfacing (DSI, CSI, I2C, etc.)”