User avatar
Hitechcomputergeek
Posts: 28
Joined: Wed Nov 27, 2013 4:29 am

Tontec 2.4-inch TFT LCD

Fri Dec 27, 2013 6:31 am

I recently got a Tontec 2.4-inch TFT LCD 240x320 RGB Pixels Touch Screen Display Monitor For Raspberry Pi from Amazon, and I have no idea how to get it set up. There were no directions included with the touchscreen when it arrived, and the directions given online at Amazon only tell you how to run the software (I think) and give no mention of hooking the display up itself. Any ideas? Should I just plug it in on top of the Pi's GPIO pins and plug in a power cable in, or do I need to do something else? And can I just run the program, or do I have to do something else? I am fairly new to the Raspberry Pi. Thanks!

User avatar
AndyD
Posts: 2329
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Tontec 2.4-inch TFT LCD

Fri Dec 27, 2013 6:58 am


robotman43
Posts: 1
Joined: Tue Jan 07, 2014 3:52 am

Re: Tontec 2.4-inch TFT LCD

Tue Jan 07, 2014 3:55 am

Hi -


Did you ever find any more info on this ?

I just purchased the same LCD display and have the same questions.
I did see the zip file but it does not discuss anything about the hookup or power supply or complete functionality of the device.

thx!

User avatar
AndyD
Posts: 2329
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Tontec 2.4-inch TFT LCD

Tue Jan 07, 2014 7:45 am

robotman43 wrote:...I did see the zip file but it does not discuss anything about the hookup or power supply or complete functionality of the device...
From the look of things it just plugs straight onto the Raspberry Pi's GPIO pins. One of the reviews on the Amazon page says that no external power is required, so I would try that first.
I had a look at the zip file referenced on Amazon. There is a file called manual.txt that explains how to compile and run the software.

User avatar
Hitechcomputergeek
Posts: 28
Joined: Wed Nov 27, 2013 4:29 am

Re: Tontec 2.4-inch TFT LCD

Fri Jan 10, 2014 11:08 pm

Sorry I haven't replied- I've been very busy. I have managed to get this working- I used an external power supply. The first time I looked, I couldn't find one. I think the reason it didn't work being powered via USB was because I haven't been able to find a 2 amp USB power supply, and so I am using a 1 amp power supply, not enough to power the Pi and the touchscreen at the same time. The person on Amazon probably had a 2 amp USB power supply. However, the power supply I found for the touchscreen was 2 amps.
The next problem I have is how to get the touchscreen part working. It just doesn't do anything when I touch it. And is there any way to add real-time clock capability to it?

NetOperator Wibby
Posts: 16
Joined: Wed May 23, 2012 3:27 am

Re: Tontec 2.4-inch TFT LCD

Tue Jan 21, 2014 2:44 pm

Hitechcomputergeek wrote:Sorry I haven't replied- I've been very busy. I have managed to get this working- I used an external power supply. The first time I looked, I couldn't find one. I think the reason it didn't work being powered via USB was because I haven't been able to find a 2 amp USB power supply, and so I am using a 1 amp power supply, not enough to power the Pi and the touchscreen at the same time. The person on Amazon probably had a 2 amp USB power supply. However, the power supply I found for the touchscreen was 2 amps.
The next problem I have is how to get the touchscreen part working. It just doesn't do anything when I touch it. And is there any way to add real-time clock capability to it?
Have you figured out how to get the screen to turn on when you boot?

sfitzjava
Posts: 1
Joined: Wed Jan 22, 2014 7:18 pm

Re: Tontec 2.4-inch TFT LCD

Wed Jan 22, 2014 7:21 pm

Does anyone have documentation on how to write the driver for this board?
I have the driver that was on the link to amazon and the screen working (not the touch however).

I would like to find out more details on how to actually program it to be more useful and also to be able to turn it off when not needed.

Any info would be greatly appreciated

Thanks,

User avatar
Hitechcomputergeek
Posts: 28
Joined: Wed Nov 27, 2013 4:29 am

Re: Tontec 2.4-inch TFT LCD

Wed Jan 22, 2014 8:42 pm

NetOperator Wibby wrote: Have you figured out how to get the screen to turn on when you boot?
Yes, I have. However, I haven't gotten the touchscreen part working.

xof
Posts: 33
Joined: Thu Aug 29, 2013 10:35 am

Re: Tontec 2.4-inch TFT LCD

Fri Jan 24, 2014 5:13 pm

See
http://helloraspberrypi.blogspot.be/201 ... 0x320.html
and
http://helloraspberrypi.blogspot.be/201 ... cally.html

It doesn't explain the 'touch' part of it but the screen setup seems straightforward.

The manual.txt in the zip file says that the TSC2003 driver (TSC2007) should be in the kernel. It is on the/an i2c bus. (http://www.ti.com/lit/ds/symlink/tsc2003.pdf is the chip handling the touch functionality)

There is some infos on the I2C on the RPi on
http://marks-space.com/2013/04/29/guide ... pberry-pi/
There are things to configure and i2c-tools can help debugging.

I haven't got mine yet. I expect it next week.

xof

User avatar
dougie
Posts: 6
Joined: Sat Jan 12, 2013 7:01 am
Location: NRW, Germany
Contact: Website

Re: Tontec 2.4-inch TFT LCD

Mon Jan 27, 2014 1:13 pm

...I feel we're not too far away. At least I can "see" the TSC2003 I2C device on the I2C device list.

According to the datasheet, it should have address 0x48 ... which is present!

BR
Ralf

growlf
Posts: 2
Joined: Tue Jan 28, 2014 8:59 pm

Re: Tontec 2.4-inch TFT LCD

Tue Jan 28, 2014 9:01 pm

*bump* ..any news on the touch-screen part from any corners?


User avatar
dougie
Posts: 6
Joined: Sat Jan 12, 2013 7:01 am
Location: NRW, Germany
Contact: Website

Re: Tontec 2.4-inch TFT LCD

Wed Jan 29, 2014 6:14 am

well, some...

According to the info I collected I tried to compile the tsc2007.ko module .... but failed.

I followed the instruction here: https://github.com/osandov/raspi/tree/master/tsc2007

It's said the touchscreen using a tsc2003 chip could make use of this driver. However, when starting "make" it takes a whole day and night for the RPi for compiling all the modules. But at the end there's no tsc2007.ko and no tsc_raspi.ko where it should be.
Therefore "make install" fails.

damn...

BR
Ralf

Here's the error message:

Code: Select all

[email protected] ~/tsc2007 $ make
make -C /lib/modules/3.10.27+/build M=/home/pi/tsc2007 modules
make[1]: Entering directory `/usr/src/kernels/3.10.27+'
  CC [M]  /home/pi/tsc2007/tsc2007.o
/home/pi/tsc2007/tsc2007.c:276:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘tsc2007_probe’
/home/pi/tsc2007/tsc2007.c:368:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘tsc2007_remove’
/home/pi/tsc2007/tsc2007.c:397:19: error: ‘tsc2007_probe’ undeclared here (not in a function)
/home/pi/tsc2007/tsc2007.c:398:9: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/home/pi/tsc2007/tsc2007.c:398:32: error: ‘tsc2007_remove’ undeclared here (not in a function)
/home/pi/tsc2007/tsc2007.c:167:20: warning: ‘tsc2007_soft_irq’ defined but not used [-Wunused-function]
/home/pi/tsc2007/tsc2007.c:227:20: warning: ‘tsc2007_hard_irq’ defined but not used [-Wunused-function]
/home/pi/tsc2007/tsc2007.c:249:12: warning: ‘tsc2007_open’ defined but not used [-Wunused-function]
/home/pi/tsc2007/tsc2007.c:269:13: warning: ‘tsc2007_close’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[2]: *** [/home/pi/tsc2007/tsc2007.o] Error 1
make[1]: *** [_module_/home/pi/tsc2007] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.10.27+'
make: *** [all] Error 2

xof
Posts: 33
Joined: Thu Aug 29, 2013 10:35 am

Re: Tontec 2.4-inch TFT LCD

Thu Jan 30, 2014 6:57 am

I tried to compile the kernel the old way (10..15 years ago I used to...)

Something like :
- get the sources (somethink like 'sudo apt-get install linux-source')
- cd /usr/src ; tar xvfj linux-source-3.2.tar.bz2 ; cd linux-source...; bzcat ../... |patch ...
you then have to get a 'config' (zcat /proc/config.gz >.config)
configure a kernel with a tsc2007 module (I used 'make xconfig' (*))
There should now be a 'CONFIG_TOUCHSCREEN_TSC2007=m' in the .config file
Then 'make'...
(I am voluntary vague because I am not sure it is the way to go; it is just to give some hints)

...unfortunately, I got some errors (after around 7 hours of compilation) ;vchi_<something> undefined with 'sound/arm/snd-bcm2835.ko' and get no kernel/modules. (I got a 'tsc2007.o' (but no '.ko' files as these are generated later))

So, the touchscreen of the Tontec should work, the current problem is to generate a kernel with a tsc2007 module.

I should have a look at http://elinux.org/RPi_Kernel_Compilation?
('Class 10' SD card can help for speed but probably not as much as cross-compilation)

The next problem could be to tell X to use it as input device (?).

(I intend to recompile a 'small' kernel without unneeded or problematic drivers : it will be faster and I hope successful)
-------------
(*) I used to 'export DISPLAY=myhost:0.0' on one side and 'xhost +' on the other side but (it was too simple...) Ubuntu now launch 'X' with a '-nolisten' option... (edit /etc/lightdm/lightdm.conf (+ xserver-allow-tcp=true ), ...or somewhere else)

User avatar
axeman199
Posts: 1
Joined: Fri Jan 31, 2014 1:52 am

Re: Tontec 2.4-inch TFT LCD

Fri Jan 31, 2014 1:58 am

dougie wrote:well, some...

According to the info I collected I tried to compile the tsc2007.ko module .... but failed.

I followed the instruction here: https://github.com/osandov/raspi/tree/master/tsc2007

It's said the touchscreen using a tsc2003 chip could make use of this driver. However, when starting "make" it takes a whole day and night for the RPi for compiling all the modules. But at the end there's no tsc2007.ko and no tsc_raspi.ko where it should be.
Therefore "make install" fails.

damn...
I am having the same issue, with the same errors being output. Wondering if anyone has a solution out there or can point out to me what we are doing wrong here.

BlindSquirrel
Posts: 49
Joined: Mon Jan 06, 2014 3:57 am
Location: US

Re: Tontec 2.4-inch TFT LCD

Fri Jan 31, 2014 2:19 am

Considering purchasing this. Please PM me when you're done and tell me how it works! Thanks
If you want a huge list of why I love Steve Jobs, but I strongly dislike Apple, say 'Apple is better than Microsoft'. I DARE you.

User avatar
dougie
Posts: 6
Joined: Sat Jan 12, 2013 7:01 am
Location: NRW, Germany
Contact: Website

Re: Tontec 2.4-inch TFT LCD

Fri Jan 31, 2014 7:07 am

Sure! Please send me your address. I'll come along an install the driver on your computer, that you don't have to move a finger... :roll:

xof
Posts: 33
Joined: Thu Aug 29, 2013 10:35 am

Re: Tontec 2.4-inch TFT LCD

Fri Jan 31, 2014 10:23 am

xof wrote:I tried to compile the kernel the old way (10..15 years ago I used to...)
[...]
...unfortunately, I got some errors (after around 7 hours of compilation) ;vchi_<something> undefined with 'sound/arm/snd-bcm2835.ko' and get no kernel/modules. (I got a 'tsc2007.o' (but no '.ko' files as these are generated later))
[...]
The situation was not as bad as I feared. I feared a global setup problem but it was just a punctual dependence problem. Adding the missing stuff in the config solved the problem.

I just (checked 'Misc devices' and) added 'videocore VCHIQ' (BCM2708-VCHIQ) as hardlink (but maybe module is enough (?)) in the config (still using 'make xconfig') and compilation went further (with no undefined symbols this time). I got a zImage and .ko files (including a tsc2007.ko).

Unfortunately, the module version (I made) doesn't match the kernel version (I run) and I can thus not 'insmod tsc2007.ko' .
I don't dare to 'make install' yet (I don't want to 'brick' my system; I'll buy another SD card to make the test).

Anyway I didn't receive the hardware yet.

(This post just to say that it is probably not necessary to use a bleeding edge kernel with some special pixie dust to have tsc2007/tsc2003 support. The 'normal way' (if there is one) should do : get some sources->configure->build->install)

((In case tsc2007.ko doesn't work (who knows?) http://osdir.com/ml/linux-kernel/2009-06/msg07628.html was trying to make a tsc2003 driver but it didn't make its way to the kernel))

xof
Posts: 33
Joined: Thu Aug 29, 2013 10:35 am

Re: Tontec 2.4-inch TFT LCD

Sat Feb 01, 2014 12:13 pm

xof wrote: I don't dare to 'make install' yet (I don't want to 'brick' my system; I'll buy another SD card to make the test).
I bought an 8GB class 10 SD card and started a new system from
2014-01-07-wheezy-raspbian.zip on http://www.raspberrypi.org/downloads ...
-- the procedure description is voluntary fuzzy - don't try if you don't understand it --
(unzip...dd...raspi-config (to extend root partition to the whole card))

$ apt-cache search linux-source
(choose one - (warning, 'linux-source' defaults to 3.2 which is probably old (jan 2012))
( http://kernelnewbies.org/Linux_3.10 -some-release is post jun 2013; the kernel running on 2014-01-07-wheezy-raspbian.zip is more recent; you can 'git clone' the latest one if you dare)
$ sudo apt-get install linux-source-<some-version> libqt4-dev
(you'll need libqt4-dev if you use 'make xconfig' otherwise, not)
$ cd /usr/src
(untar the source; note: you don't need to be root to compile the whole stuff...)
$ cd linux-source-<some version>
(apply the patches; (eventually) make mrproper; get the running config : zcat /proc/config.gz > .config)
(probably 'export KERNEL_SRC=/usr/src/linux-source-<some-version>; export DISPLAY=<some-host>:0.0; 'xhost +' on this (ready) host if you intend to use xconfig; don't forget an 'X -nolisten' problem on some distribs)
$ make xconfig
(<ctrl>-F tsc2007 - check the box to say you want a module; if it's grey, check 'touchscreens' upper in the tree) - save)
$ nohup make > ~/build-messages.20140201.123300.txt 2>&1
(it will take hours - check messages are building up in the .txt file and have a walk)
(the 'nohup' allows the process to go unattended as I proceed through Ethernet and shut my main host down)

if everything is ok, after 10 hours or so (with a class 10 SD card), the message file stops growing and there is no error message at the end. You now have an ./arch/arm/boot/zImage and a lot of .ko files in your source tree.

$ sudo make modules_install
(it will copy the .ko files in /lib/modules/<some-version>/ ; if it is not your running version, there is no risk; if it is, you could try to insmod tsc2007.ko instead)

$ sudo cp arch/arm/boot/zImage /boot/kernel.img
(it may be prudent to save a copy of the current kernel.img before - (there is a /boot/kernel_emergency.img but who knows...)

$ sudo reboot
(if it fails to reboot, use another system to restore /boot/kernel.img)

You now should be able to 'sudo modprobe tsc2007' (if not already loaded by some magic trick (?) (lsmod can tell))

I can't test it, I didn't receive my Tontec yet... (next, have a look at 'xinput_calibrator')

So, recompiling the kernel is not so complicated nor dangerous after all (there are a lot of steps but it is not as complicated as described in http://elinux.org/RPi_Kernel_Compilation : just 1/ get the sources - 2/ configure - 3/ build - 4/ install - 5/ reboot ; however, the Devil may hide in the details...(?))

User avatar
Hitechcomputergeek
Posts: 28
Joined: Wed Nov 27, 2013 4:29 am

Re: Tontec 2.4-inch TFT LCD

Sat Feb 01, 2014 6:57 pm

xof wrote: I bought an 8GB class 10 SD card and started a new system from
2014-01-07-wheezy-raspbian.zip on http://www.raspberrypi.org/downloads ...
-- the procedure description is voluntary fuzzy - don't try if you don't understand it --
(unzip...dd...raspi-config (to extend root partition to the whole card))

$ apt-cache search linux-source
(choose one - (warning, 'linux-source' defaults to 3.2 which is probably old (jan 2012))
( http://kernelnewbies.org/Linux_3.10 -some-release is post jun 2013; the kernel running on 2014-01-07-wheezy-raspbian.zip is more recent; you can 'git clone' the latest one if you dare)
$ sudo apt-get install linux-source-<some-version> libqt4-dev
(you'll need libqt4-dev if you use 'make xconfig' otherwise, not)
$ cd /usr/src
(untar the source; note: you don't need to be root to compile the whole stuff...)
$ cd linux-source-<some version>
(apply the patches; (eventually) make mrproper; get the running config : zcat /proc/config.gz > .config)
(probably 'export KERNEL_SRC=/usr/src/linux-source-<some-version>; export DISPLAY=<some-host>:0.0; 'xhost +' on this (ready) host if you intend to use xconfig; don't forget an 'X -nolisten' problem on some distribs)
$ make xconfig
(<ctrl>-F tsc2007 - check the box to say you want a module; if it's grey, check 'touchscreens' upper in the tree) - save)
$ nohup make > ~/build-messages.20140201.123300.txt 2>&1
(it will take hours - check messages are building up in the .txt file and have a walk)
(the 'nohup' allows the process to go unattended as I proceed through Ethernet and shut my main host down)

if everything is ok, after 10 hours or so (with a class 10 SD card), the message file stops growing and there is no error message at the end. You now have an ./arch/arm/boot/zImage and a lot of .ko files in your source tree.

$ sudo make modules_install
(it will copy the .ko files in /lib/modules/<some-version>/ ; if it is not your running version, there is no risk; if it is, you could try to insmod tsc2007.ko instead)

$ sudo cp arch/arm/boot/zImage /boot/kernel.img
(it may be prudent to save a copy of the current kernel.img before - (there is a /boot/kernel_emergency.img but who knows...)

$ sudo reboot
(if it fails to reboot, use another system to restore /boot/kernel.img)

You now should be able to 'sudo modprobe tsc2007' (if not already loaded by some magic trick (?) (lsmod can tell))

I can't test it, I didn't receive my Tontec yet... (next, have a look at 'xinput_calibrator')

So, recompiling the kernel is not so complicated nor dangerous after all (there are a lot of steps but it is not as complicated as described in http://elinux.org/RPi_Kernel_Compilation : just 1/ get the sources - 2/ configure - 3/ build - 4/ install - 5/ reboot ; however, the Devil may hide in the details...(?))
Will try this soon.

xof
Posts: 33
Joined: Thu Aug 29, 2013 10:35 am

Re: Tontec 2.4-inch TFT LCD

Sun Feb 02, 2014 5:23 am

Hitechcomputergeek wrote:Will try this soon.
On 2014-01-07-wheezy-raspbian, apt-cache search linux-source offers 3.2, 3.6, 3.10 (...) kernel sources (but I did not find the running one... (?) - as I remember, linux-source is 3.2)

(3.2 seems ok (after VHCI dependence correction) but, curiously, 'sudo shutdown -h now' reboots (i.e. doesn't 'halt') with this kernel (?!))
3.6 seems ok (but I used the working config of 3.2 with the VHCI problem solved)
3.10 seems broken (compilation errors in kernel/printk.c (!); I don't know yet how serious it is)

The building process takes around 7 hours on my machine (and not 10 as I wrote; it is a good idea to check it is still running from time to time; as I power my DHCP server down and the DHCP-lease is not long enough, sometimes, it takes time to recover the ssh link (ssh [email protected]); only the Raspberry Pi and my Ethernet switch/hub stays up, it is silent and low power; curiously I cannot power the switch/hub off without reseting the Raspberry Pi (?) - I don't know the reason of this)

I don't know if there are more recent 'stable' versions (nor how risky it is to 'git clone' the latest one).

xof

edjuh
Posts: 18
Joined: Sat Dec 21, 2013 12:38 pm

Re: Tontec 2.4-inch TFT LCD

Thu Feb 06, 2014 12:25 pm

How does one actually apply the patches?
( I got that far )

xof
Posts: 33
Joined: Thu Aug 29, 2013 10:35 am

Re: Tontec 2.4-inch TFT LCD

Thu Feb 06, 2014 4:48 pm

edjuh wrote:How does one actually apply the patches?
( I got that far )
Let's suppose you are using 3.2, it is something like :

$ tar xfj linux-source-3.2.tar.bz2
$ cd linux-source-3.2
$ bzcat ../linux-patch-3.2-rt.patch.bz2 |patch -p1

(for 3.10, xzcat instead of bzcat)

xof

edjuh
Posts: 18
Joined: Sat Dec 21, 2013 12:38 pm

Re: Tontec 2.4-inch TFT LCD

Thu Feb 06, 2014 10:06 pm

thx xof ... Now it's up to the PI ;D

tankh
Posts: 1
Joined: Fri Feb 07, 2014 12:11 am

Re: Tontec 2.4-inch TFT LCD

Fri Feb 07, 2014 12:14 am

edjuh wrote:thx xof ... Now it's up to the PI ;D
Good luck :D Please share your findings. I am also trying hard to get the touchscreen to work. Hope yours is 3.10.28+ =)

Return to “Beginners”