Hi Team,
I have a few queries regarding the ADS7846 touchscreen controller and AM62 Sitara processor.
Development Environment
-
Hardware: Verdin Development Board with Verdin AM62 SoM (based on AM62 Sitara processor)
-
Display: 3.5" MSP3520 TFT
-
Display Controller: ILI9488
-
Touch Controller: ADS7846
-
Interface: SPI0 bus (shared between display and touchscreen on seperate CS)
The display and touchscreen share the same CLK, MOSI, and MISO lines — though MISO is only used by the touchscreen (not required by the display).
The display is connected to CS0, and the touchscreen is connected to CS1.
The ADS7846 driver is already available in the Linux kernel, so I have directly used it in my device tree overlay.
The display is working fine using my own application code (without using any external ILI9488 driver source).
I tested the touch functionality using evtest.
However, evtest is not providing any touch coordinates — it fails to show any touch data.
evtest Output
torizon@verdin-am62-15415886:~$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0: gpio-keys
/dev/input/event1: tps65219-pwrbutton
/dev/input/event2: ADS7846 Touchscreen
Select the device event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x1c vendor 0x0 product 0x1ea6 version 0x0
Input device name: "ADS7846 Touchscreen"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 0
Min 0
Max 4095
Event code 24 (ABS_PRESSURE)
Value 0
Min 0
Max 255
Properties:
Testing ... (interrupt to exit)
^C
### Not giving any touch coordinates when I touch the display
Troubleshooting Steps
1. ADS7846 Driver Loaded
$ cat /sys/bus/spi/devices/spi0.1/modalias
spi:ads7846
2. Both SPI Devices Registered
$ ls -la /sys/bus/spi/devices/
spi0.0 -> Display
spi0.1 -> Touchscreen
3. Device Nodes Present
/dev/spidev0.0 → Display
/dev/input/event2 → Touchscreen
4. Interrupt Count Increases on Touch
Before touch: 75857
After touch: 77781
5. SPI Transactions Occurring (verified through /sys/class/spi_master/spi0/statistics)
- Byte count and message count increase when the screen is touched.
6. GPIO Verified
SODIMM_212 configured as Touch Interrupt (gpio-535 | pendown)
The GPIO input correctly transitions from high → low → high when touching and releasing the screen.
7. pen_down Value Always 0
$ cat /sys/bus/spi/devices/spi0.1/pen_down
0
Expected: The value should go 1 when touched, but it remains 0 always.
Device Tree Overlay
(verdin-am62_msp3520_tft_display_spi3_overlay.dts)
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include "k3-pinctrl.h"
/ {
compatible = "toradex,verdin-am62";
};
/* Disable HDMI and conflicting peripherals */
&{/hdmi-connector}, &{/bus@f0000/i2c@20010000/hdmi@48}, &{/connector} {
status = "disabled";
};
/* Disable PWM modules */
&epwm0 { status = "disabled"; };
&epwm1 { status = "disabled"; };
/* SPI0 (Verdin SPI_3) pin configuration */
&main_pmx0 {
spi3_pins_default: spi3-default-pins {
pinctrl-single,pins = <
AM62X_IOPAD(0x01bc, PIN_OUTPUT, 0) /* SPI0_CLK - SODIMM 19 */
AM62X_IOPAD(0x01b4, PIN_OUTPUT, 0) /* SPI0_CS0 - SODIMM 15 */
AM62X_IOPAD(0x01b8, PIN_OUTPUT, 0) /* SPI0_CS1 - SODIMM 16 */
AM62X_IOPAD(0x01c4, PIN_OUTPUT, 0) /* SPI0_D1 (MOSI) - SODIMM 161 */
AM62X_IOPAD(0x01c0, PIN_INPUT, 0) /* SPI0_D0 (MISO) - SODIMM 66 */
>;
};
};
/* MCU GPIO pins (SODIMM_206–212) configuration */
&mcu_pmx0 {
pinctrl_sodimm_212_gpio: sodimm-212-gpio-pins {
pinctrl-single,pins = <
AM62X_MCU_IOPAD(0x0010, PIN_INPUT, 7) /* MCU_GPIO0_4 - Touch IRQ */
>;
};
};
&main_spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi3_pins_default>;
status = "okay";
ti,spi-num-cs = <2>;
#address-cells = <1>;
#size-cells = <0>;
/* MSP3520 Display on CS0 */
msp3520_display@0 {
compatible = "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <32000000>;
reset-gpios = <&mcu_gpio0 2 GPIO_ACTIVE_LOW>;
dc-gpios = <&mcu_gpio0 1 GPIO_ACTIVE_HIGH>;
led-gpios = <&mcu_gpio0 3 GPIO_ACTIVE_HIGH>;
};
/* ADS7846 Touchscreen on CS1 */
msp3520_touch@1 {
compatible = "ti,ads7846";
reg = <1>;
spi-max-frequency = <1250000>;
vcc-supply = <®_3v3>;
interrupt-parent = <&mcu_gpio0>;
interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
pendown-gpio = <&mcu_gpio0 4 GPIO_ACTIVE_LOW>;
ti,x-plate-ohms = /bits/16 <400>;
ti,pressure-max = /bits/16 <255>;
ti,x-min = /bits/16 <0>;
ti,x-max = /bits/16 <4095>;
ti,y-min = /bits/16 <0>;
ti,y-max = /bits/16 <4095>;
ti,settle-delay-usec = /bits/16 <150>;
ti,penirq-recheck-delay-usecs = /bits/16 <100>;
ti,vref-delay-usecs = /bits/16 <100>;
ti,vref-mv = /bits/16 <3300>;
ti,debounce-rep = /bits/16 <1>;
ti,debounce-tol = /bits/16 <50>;
ti,debounce-max = /bits/16 <3>;
ti,keep-vref-on;
wakeup-source;
};
};
Summary
-
ADS7846 driver is successfully probed and interrupts are triggered on touch.
-
SPI transactions are occurring correctly.
-
GPIO input toggles as expected on touch.
-
However,
pen_downvalue remains0, andevtestdoes not display any touch coordinates.
Could you please review and suggest what might be causing the pen_down status to remain low and why touch coordinates are not reported despite valid SPI and interrupt activity?
Also, can we use shared bus for both display and touchscreen? Did touch controller (ADS7846) demands seperate bus?
Thanks & Regards,
Meenakshy