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.

Atmel maXTouch USB HID Touchscreen AM335x

Other Parts Discussed in Thread: AM3354, ASH

Hello:

I'm using a custom board AM3354 with Atmel's mXT540e connected it to USB interface.

We want use the Qt browser only from the matrix-gui app

Please check the following details;

root@am335x-evm:/usr/bin# lsusb

Bus 001 Device 011: ID 03eb:2126 Atmel Corp.

root@am335x-evm:~# cat /etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

for i in /etc/profile.d/* ; do
. $i
done
unset i
fi

export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM

export QWS_MOUSE_PROTO="Tslib:/dev/input/event0"
export QWS_SIZE=800*480

export TSLIB_PLUGINDIR=/usr/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CONSOLEDEVICE=none
export TSLIB_TSEVENTTYPE=INPUT
export TSLIB_TSDEVICE=/dev/input/event0

#export QT_QPA_PLATFORM=eglfs
#export QT_QPA_GENERIC_PLUGINS=libinput
#export QT_QPA_EGLFS_HIDECURSOR=1
#export QT_QPA_EGLFS_DISABLE_INPUT=1
umask 022

~
root@am335x-evm:~# cat /etc/ts.conf
# Uncomment if you wish to use the linux input layer event interface
module_raw input

# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
# module_raw collie

# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
# module_raw corgi

# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
# module_raw ucb1x00

# Uncomment if you're using an HP iPaq h3600 or similar
# module_raw h3600

# Uncomment if you're using a Hitachi Webpad
# module_raw mk712

# Uncomment if you're using an IBM Arctic II
# module_raw arctic2

#module pthres pmin=400
#module drop_first_n drop=2
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

root@am335x-evm:~# cat /etc/pointercal
3147 -23368 35371704 21877 8192 2770144 65536 800 480



root@am335x-evm:~# ls /usr/lib/ts/
dejitter.so input.so pthres.so variance.so
dmc.so linear.so tatung.so
galax.so linear_h2200.so touchkit.so
root@am335x-evm:~#

root@am335x-evm:~# cat /etc/init.d/matrix-gui-2.0
#! /bin/sh

matrixgui="/usr/bin/matrix_browser"
ROTATION="transformed:rot0"
GUI_OPTS="-qws -display $ROTATION http://localhost:80/"
PIDFILE="/var/run/matrix-gui-2.0.pid"

test -x "$matrixgui" || exit 0

#export TSLIB_TSDEVICE=/dev/input/touchscreen0
export TSLIB_TSDEVICE=/dev/input/event0
......
root@am335x-evm:~#

root@am335x-evm:~# fbset

mode "800x480-57"
# D: 27.273 MHz, H: 32.162 kHz, V: 56.623 Hz
geometry 800 480 800 960 32
timings 36666 16 16 40 8 16 40
rgba 8/16,8/8,8/0,8/24
endmode

root@am335x-evm:~# uname -a
Linux am335x-evm 3.2.0 #437 PREEMPT Thu Sep 17 23:55:50 CDT 2015 armv7l GNU/Linux

ti-sdk-am335x-evm-06.00.00.00 used.\

I’m able to cat /dev/input/event0 hence modified the environment variable TSLIB_TSDEVICE to /dev/input/event0

The touch co-ordinates are correct but the movement of the cursor is faster and incorrect.

I also wants the USB mouse to be functional when connected. Using Auto to after /dev/input/event0 for QWS_MOUSE_PROTO makes it work but touchscreen goes bad.

Please suggest on the changes required. 

Regards,

Waman Prabhu.

  • Hi,

    I will forward this to the USB experts.
  • We just need the Web-browser hence modified browser.sh and not the matrix-gui script. The requirement is to rotate the screen therefore “-display transformed:rot180” is used.
    With export QWS_MOUSE_PROTO="Tslib:/dev/input/event0 Auto" I’m able to get the USB mouse working.

    If you enable both, the touchscreen now requires a double touch instead of a single touch from processors.wiki.ti.com/.../How_to_use_a_Mouse_instead_of_the_Touchscreen_with_Matrix

    Irrespective of supplying Auto to QWS_MOUSE_PROTO. The touch/click requires double taps i.e; it doesn’t get a right coordinate for first tap rather it misses it and then for the second tap you see the click event at the point you tapped first.

    root@am335x-evm:~# cat /usr/bin/browser.sh
    #!/bin/sh
    if test -e /dev/fb0; then
    width=`fbset | grep 'geometry' | awk '{print $2}'`
    height=`fbset | grep 'geometry' | awk '{print $3}'`

    #let height=height-38
    geo=`echo $width\x$height+0+0`
    fi

    pidof matrix_browser > /dev/null 2>&1
    if [ $? == 0 ]
    then
    /usr/bin/qtopia/demos/browser/browser -display transformed:rot0 -geometry $geo $*
    else
    export TSLIB_TSDEVICE=/dev/input/event0
    export QWS_MOUSE_PROTO="Tslib:/dev/input/event0 Auto"
    export QWS_SIZE=800*480
    /usr/bin/qtopia/demos/browser/browser -qws -display transformed:rot180 -geometry $geo $*
    fi
    #the bold text above is the modified entry to the file.
    -----------------------------------------------------------------------------------------------------------------------------
    tscadc is disabled.
    I’m not able test ts_test may be because of the rotated display. I’m not sure of this though.
    Is there anything which I’m missing here?

    Appreciate your support on this.