TS-8390-47XX Touchscreen

From Technologic Systems Manuals

The baseboard includes the ADS7843 touchscreen controller, and the FPGA includes a controller to simplify this access. The FPGA presents 2 registers at 0x80005000 which include the x/y values from 0-4096, and a bit indicating if the touch is currently being activated. Linux implements this at a higher level using the "ts_lcd" driver which abstracts this through Linux's event input interface. X11 can use this with the "evdev" driver by default.

Offset Bits Description
0x0 15:1 X touch position value
0 Touch Flag (1=touch)
0x2 15:1 Y touch position
0 Touch Flag (1=touch)

The calibration values appropriate to this touchscreen are passed to the "ts_lcd" driver as module parameters. We have found that the same calibration values work consistently in this model, but it is possible to get new calibration values using tscalib.

Note: The hard coded calibration values should be used unless you are experiencing a problem with our default values.

To get calibration values manually you can use tscalib. This needs to be downloaded and built to be used on the board:

# Install prerequisites:
apt-get install pkg-config libdirectfb-dev build-essential fbset -y

# Download & Build
wget ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4710-linux/sources/tscalib.c
gcc -mcpu=arm9 `pkg-config directfb --libs --cflags` tscalib.c -o tscalib
mv tscalib /usr/bin/

# DirectFB requires the video mode you are using to be the first in
# the /etc/fb.modes file.  This file uses the same format as fbset.
cp /etc/fb.modes /etc/fb.modes.orig
fbset > /etc/fb.modes

# Now that everything is installed you can calibrate:
killall Xorg
tscalib --calibrate --test

This will draw crosshairs in each corner which need to be pressed to generate values like these:


You can test these by passing them to ts_lcd:

modprobe -r ts_lcd
modprobe ts_lcd calib_x0=87 calib_dx=3867 calib_y0=129 calib_dy=3848
startx # or start_xinit from initramfs if you aren't in Debian