This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI SDK 2.00.00.00 Beaglebone Black Touchscreen (4Dcape-43T)



Hi,

i have running the prebuilt binaries from the ti sdk on a beagleboneblack with a 4Dcape-43T.

All seems to work fine except the touchscreen.

The ts_calibrate is finishing after a short amount of time, the ts_test utility is continuously producing output.

Can you give me a hint where the issue can be?

Best regards

Erich

  • Hi Biser,

    followed the documentation, should be fine in my configuration.

    What i have seen, when i'm doing

    cat /sys/bus/iio/devices/iio:device0/in_voltage4_raw

    the value is floating

    is there anything to consider, configuration of the cpu pins etc.. ?

    My dts file:

    /*
     * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License version 2 as
     * published by the Free Software Foundation.
     */
    /dts-v1/;
    
    #include "am33xx.dtsi"
    #include "am335x-bone-common.dtsi"
    
    &ldo3_reg {
    	regulator-min-microvolt = <1800000>;
    	regulator-max-microvolt = <1800000>;
    	regulator-always-on;
    };
    
    &sgx {
    	status = "okay";
    };
    
    &mmc1 {
    	vmmc-supply = <&vmmcsd_fixed>;
    };
    
    &mmc2 {
    	vmmc-supply = <&vmmcsd_fixed>;
    	pinctrl-names = "default";
    	pinctrl-0 = <&emmc_pins>;
    	bus-width = <8>;
    	status = "okay";
    	ti,vcc-aux-disable-is-sleep;
    };
    
    /* Common pinmux */
    &am33xx_pinmux {
    	uart2_pins: pinmux_uart2_pins {
    		pinctrl-single,pins = <
    			0x150 (PIN_INPUT_PULLUP | MUX_MODE1) /* mii1_tx_clk.uart2_rxd */
    			0x154 (PIN_OUTPUT_PULLDOWN | MUX_MODE1) /* mii1_rx_clk.uart2_txd */
    		>;
    	};
    	
    	lcd_pins_default: lcd_pins_default {
    		pinctrl-single,pins = <
    			0xa0 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data0.lcd_data0 */
    			0xa4 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data1.lcd_data1 */
    			0xa8 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data2.lcd_data2 */
    			0xac (PIN_OUTPUT | MUX_MODE0)	/* lcd_data3.lcd_data3 */
    			0xb0 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data4.lcd_data4 */
    			0xb4 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data5.lcd_data5 */
    			0xb8 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data6.lcd_data6 */
    			0xbc (PIN_OUTPUT | MUX_MODE0)	/* lcd_data7.lcd_data7 */
    			0xc0 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data8.lcd_data8 */
    			0xc4 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data9.lcd_data9 */
    			0xc8 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data10.lcd_data10 */
    			0xcc (PIN_OUTPUT | MUX_MODE0)	/* lcd_data11.lcd_data11 */
    			0xd0 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data12.lcd_data12 */
    			0xd4 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data13.lcd_data13 */
    			0xd8 (PIN_OUTPUT | MUX_MODE0)	/* lcd_data14.lcd_data14 */
    			0xdc (PIN_OUTPUT | MUX_MODE0)	/* lcd_data15.lcd_data15 */
    			0xe0 (PIN_OUTPUT | MUX_MODE0)	/* lcd_vsync.lcd_vsync */
    			0xe4 (PIN_OUTPUT | MUX_MODE0)	/* lcd_hsync.lcd_hsync */
    			0xe8 (PIN_OUTPUT | MUX_MODE0)	/* lcd_pclk.lcd_pclk */
    			0xec (PIN_OUTPUT | MUX_MODE0)	/* lcd_ac_bias_en.lcd_ac_bias_en */
    		>;
    	};
    
    	lcd_pins_sleep: lcd_pins_sleep {
    		pinctrl-single,pins = <
    			0xa0 (PULL_DISABLE | MUX_MODE7)	/* lcd_data0.lcd_data0 */
    			0xa4 (PULL_DISABLE | MUX_MODE7)	/* lcd_data1.lcd_data1 */
    			0xa8 (PULL_DISABLE | MUX_MODE7)	/* lcd_data2.lcd_data2 */
    			0xac (PULL_DISABLE | MUX_MODE7)	/* lcd_data3.lcd_data3 */
    			0xb0 (PULL_DISABLE | MUX_MODE7)	/* lcd_data4.lcd_data4 */
    			0xb4 (PULL_DISABLE | MUX_MODE7)	/* lcd_data5.lcd_data5 */
    			0xb8 (PULL_DISABLE | MUX_MODE7)	/* lcd_data6.lcd_data6 */
    			0xbc (PULL_DISABLE | MUX_MODE7)	/* lcd_data7.lcd_data7 */
    			0xc0 (PULL_DISABLE | MUX_MODE7)	/* lcd_data8.lcd_data8 */
    			0xc4 (PULL_DISABLE | MUX_MODE7)	/* lcd_data9.lcd_data9 */
    			0xc8 (PULL_DISABLE | MUX_MODE7)	/* lcd_data10.lcd_data10 */
    			0xcc (PULL_DISABLE | MUX_MODE7)	/* lcd_data11.lcd_data11 */
    			0xd0 (PULL_DISABLE | MUX_MODE7)	/* lcd_data12.lcd_data12 */
    			0xd4 (PULL_DISABLE | MUX_MODE7)	/* lcd_data13.lcd_data13 */
    			0xd8 (PULL_DISABLE | MUX_MODE7)	/* lcd_data14.lcd_data14 */
    			0xdc (PULL_DISABLE | MUX_MODE7)	/* lcd_data15.lcd_data15 */
    			0xe0 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* lcd_vsync.lcd_vsync */
    			0xe4 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* lcd_hsync.lcd_hsync */
    			0xe8 (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* lcd_pclk.lcd_pclk */
    			0xec (PIN_INPUT_PULLDOWN | MUX_MODE7)	/* lcd_ac_bias_en.lcd_ac_bias_en */
    		>;
    	};
    
            led_bl_pins: gpio_led_bl_pins {
    		pinctrl-single,pins = <
    			0x48  (PIN_OUTPUT | MUX_MODE7)	/* P9_14, gpmc_a[2].GPIO1[18] (backlight control) */
    		>;
    	};
    	lcd_disen_pins: lcd_disen_pins {
    		pinctrl-single,pins = <
    			0x1a4 (PIN_OUTPUT_PULLUP | MUX_MODE7)	/* P9_27, mcasp0_fsr.gpio3[19] (lcd_disen) */
    		>;
    	};
    
    };
    
    &lcdc {
    	status = "okay";
    };
    
    /* touch screen */
    &tscadc {
    		status = "okay";
    		tsc {
    		        ti,wires = <4>;
    		        ti,x-plate-resistance = <200>;
    		        ti,coordinate-readouts = <5>;
    		        ti,wire-config = <0x00 0x11 0x22 0x33>;
                            /*ti,charge-delay = <0xb000>;*/
    		};
    
    		adc {
    			ti,adc-channels = <4 5 6 7>;
    		};
    	};
    
    /* 4.3" 4D systems LCD */
    / {
    	panel {
    		compatible = "ti,tilcdc,panel";
    		pinctrl-names = "default", "sleep";
    		pinctrl-0 = <&lcd_pins_default &lcd_disen_pins>;
    		pinctrl-1 = <&lcd_pins_sleep>;
    		status = "okay";
    		panel-info {
    			ac-bias           = <255>;
    			ac-bias-intrpt    = <0>;
    			dma-burst-sz      = <16>;
    			bpp               = <16>;
    			fdd               = <0x80>;
    			sync-edge         = <0>;
    			sync-ctrl         = <1>;
    			raster-order      = <0>;
    			fifo-th           = <0>;
    		};
    		display-timings {
    			480x272 {
    				hactive         = <480>;
    				vactive         = <272>;
    				hback-porch     = <40>;
    				hfront-porch    = <5>; 
    				hsync-len       = <41>;
    				vback-porch     = <8>;
    				vfront-porch    = <8>;
    				vsync-len       = <10>;
    				clock-frequency = <9000000>;
    				hsync-active    = <0>;
    				vsync-active    = <0>;
    			};
    		};
    	};
    
    /* backlight */
            backlight {
    		status = "okay";
    		compatible = "gpio-leds";
    		pinctrl-names = "default";
                    pinctrl-0 = <&led_bl_pins>;
    		backlight {
    			label = "backlight";
    			gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
    			default-state = "on";
    		};
    	};
    
    };
    
    &uart2 {
    	pinctrl-names = "default";
    	pinctrl-0 = <&uart2_pins>;
    	status = "okay";
    };
    
    
    Best regards
    Erich

  • AIN4 voltage is ADC input, not TS. Do you have any voltage source connected there?
  • From my understanding the 4 wires of the resistive touchscreen are conncted to those 4 adc channels. So the voltage values should be pretty stable if no one touches the display.

    Best regards
    Erich
  • the command "evtest /dev/input/touchscreen0" reports endless BTN_TOUCH events, that's why the touch seems not to work. Are there any parameter to set ?
    Regards
    Erich
  • Hello Erich,

    Please, also refer to the kernel Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt file and 4d cape bone black device trees on github.com/.../arm to setup the device tree parameters . You can first setup your cape over SDK 1.3 (kernel 3.14.43) then migrate to the latest SDK 2.0 (kernel 4.1.6)

    Best regards,
    Kemal

  • Hi Kemal,
    i have found the reason for this.
    If you compare the schematics of the 4Dcape-43t with the one of the am335x evaluation module, you will see that the touch signals are differently wired to the adc channels. So to get compatible you have to write "ti,wire-config = <0x01 0x10 0x23 0x32>;" into the dts file.
    The calibration of the display and all the utilites like ts_test, ts_print(_raw) works pretty well then but when you start a Qt or the Matrix Application are interpreted the other way around which means for a touch in the top left corner the application receives a bottom right

    Is there an option to change this behaviour ?

    Best regards
    Erich

    PS There is a color issue whenever a application uses the sgx driver, blue and red color are reversed, the am335x evaluation module seems to have a hardware option to correct this but it would be interesting if i can change this in a configuration file
  • You can change this behavior by editing the export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="rotate=180" in /etc/profile.d/qt_env.sh

    For the reversed red and blue color assignment, please check the Silicon Errata section 3.1.1 www.ti.com/.../sprz360f.pdf and these similar threads:
    e2e.ti.com/.../164035
    e2e.ti.com/.../264290
    e2e.ti.com/.../442103