TS-8390-47XX Touchscreen: Difference between revisions

From embeddedTS Manuals
(Added FPGA Touchscreen core register definitions.)
 
m (Non-link text auto-updated for 2022 re-branding ( ftp://ftp.embeddedarm.com/ts-socket-macrocontrollers/ts-4710-linux/sources/tscalib.c →‎ ftp://ftp.embeddedTS.com/ts-socket-macrocontrollers/ts-4710-linux/sources/tscalib.c))
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The touch screen on the TS-TPC-8390 is comprised of a two channel ADC and a portion of the TS-47XX's FPGA.  The touch controller's raw data can be accessed for a number of custom applications, including the collection of custom calibration data and polling for specific touch instancesThis data is presented with two registers on the TS-47XX:
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 interfaceX11 can use this with the "evdev" driver by default.


{| class=wikitable
{| class=wikitable
! Address
! Offset
! Bit range
! Bits
! Function
! Description
|-
|-
| 0x80005000
| rowspan=2 | 0x0
| 15:1
| 15:1
| X touch position value
| X touch position value
|-
|-
| 0x80005000
| 0
| 0
| Touch Flag (1=touch)
| Touch Flag (1=touch)
|-
|-
| 0x80005002
| rowspan=2 | 0x2
| 15:1
| 15:1
| Y touch position value
| Y touch position  
|-
|-
| 0x80005002
| 0
| 0
| Touch Flag (1=touch)
| 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 [https://files.embeddedTS.com/ts-socket-macrocontrollers/ts-4710-linux/sources/tscalib.c tscalib].  This needs to be downloaded and built to be used on the board:
<source lang=bash>
# Install prerequisites:
apt-get install pkg-config libdirectfb-dev build-essential fbset -y
# Download & Build
wget ftp://ftp.embeddedTS.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
</source>
This will draw crosshairs in each corner which need to be pressed to generate values like these:
<pre>
calib_x0=87
calib_dx=3867
calib_y0=129
calib_dy=3848
</pre>
You can test these by passing them to ts_lcd:
<source lang=bash>
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
</source>

Latest revision as of 14:34, 18 January 2022

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.embeddedTS.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:

calib_x0=87
calib_dx=3867
calib_y0=129
calib_dy=3848

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