Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

Troubleshooting • Re: How to apply calibration matrix for touch screen based on ADS7846?

$
0
0

Code:

Name:   ads7846Info:   ADS7846 Touch controllerLoad:   dtoverlay=ads7846,<param>=<val>Params: cs                      SPI bus Chip Select (default 1)        speed                   SPI bus speed (default 2MHz, max 3.25MHz)        penirq                  GPIO used for PENIRQ. REQUIRED        penirq_pull             Set GPIO pull (default 0=none, 2=pullup)        swapxy                  Swap x and y axis        xmin                    Minimum value on the X axis (default 0)        ymin                    Minimum value on the Y axis (default 0)        xmax                    Maximum value on the X axis (default 4095)        ymax                    Maximum value on the Y axis (default 4095)        pmin                    Minimum reported pressure value (default 0)        pmax                    Maximum reported pressure value (default 65535)        xohms                   Touchpanel sensitivity (X-plate resistance)                                (default 400)        invx                    Invert x axis        invy                    Invert y axis        penirq is required and usually xohms (60-100) has to be set as well.        Apart from that, pmax (255) and swapxy are also common.        The rest of the calibration can be done with xinput-calibrator.        See: github.com/notro/fbtft/wiki/FBTFT-on-Raspian        Device Tree binding document:        www.kernel.org/doc/Documentation/devicetree/bindings/input/ads7846.txt
README is your friend - my working assumption is you've used 'ads7846' overlay for starting the driver but you've failed to populate xmax/ymax parameters.

Code:

pi@newpi5:~/linux/arch/arm/boot/dts/overlays $ sudo libinput measure touchpad-size 320x480 /dev/input/event5Device does not have resolutions.Kernel specified touchpad size: 319.0x479.0mmUser specified touchpad size:   320.0x480.0mmKernel axis range:   x [   0.. 319], y [   0.. 479]Detected axis range: x [   5.. 314], y [  15.. 474]Move one finger along all edges of the touchpaduntil the detected axis range stops changing.+------------------------------+|                              ||                              ||                              ||                              ||                              ||                              ||                              ||                              ||                              ||                             O||                              ||                              ||                              ||                              ||                              ||                              ||                              ||                              ||                              |+------------------------------+     Press Ctrl+C to stop  
with my touch specified as i.e.

Code:

                                touchscreen-size-x = <320>;                                touchscreen-size-y = <480>;                                touchscreen-x-mm = <49>;                                touchscreen-y-mm = <74>;
What looks weird is that the kernel takes pixels instead of the physical size (as the display is not 480mm but 480pixels resolution).

Code:

Kernel specified touchpad size: 319.0x479.0mmUser specified touchpad size:   320.0x480.0mm

Statistics: Posted by aBUGSworstnightmare — Mon Jul 14, 2025 9:37 am



Viewing all articles
Browse latest Browse all 8374

Trending Articles