WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Get Touchscreen with ADS7846 working  (Read 6006 times)

Offline Dirk_H

  • Newbie
  • *
  • Posts: 5
Get Touchscreen with ADS7846 working
« on: October 19, 2016, 10:50:44 AM »
Hello,

I'm using PiCore 8.0 and am trying to get a 3.5" touchscreen working.
The OUtput already works thanks to the fbtft thread.

However I'm struggling with the ADS7846 Touchscreen support. I added
Code: [Select]
dtoverlay=ads7846,speed=1000000,penirq=17,swapxy=1just below dtparam=i2c=on,spi=on,i2s=on in /mnt/mmbclk0p1/config.txt, but there seem to be problems.

After Booting there is no new /dev/input device (in raspbian a new /dev/input/event? device was created).
dmesg | grep ads results:
Code: [Select]
tc@piCorePlayer:/mnt/mmcblk0p1$ dmesg | grep ads
[   42.541341] ads7846: Unknown symbol hwmon_device_unregister (err 0)
[   42.541411] ads7846: Unknown symbol hwmon_device_register_with_groups (err 0)
[   49.948475] spi spi0.1: ads7846 spi0.1 1000kHz 8 bits mode=0x00
[   50.553065] spi spi0.1: ads7846 spi0.1 1000kHz 8 bits mode=0x00

which does not look good to me. Can anybody help me where the problem is?
Best regards
DirkH

Offline Dirk_H

  • Newbie
  • *
  • Posts: 5
Re: Get Touchscreen with ADS7846 working
« Reply #1 on: October 19, 2016, 11:11:26 AM »
I read a clue and was able to help myself :)

Although I dont fully understand how modules and device overlays interfere with each other, I tried to modprobe ads7846 and got the same error message in dmesg.

With modinfo ads7846 I discoverd that ds7846 needs hwmon. I finally added it to my tcz and now the touchscreen seems to work as /dev/input/event2. Now I'm fighting with the calibration which shows on the wrong monitor... :(

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Get Touchscreen with ADS7846 working
« Reply #2 on: October 19, 2016, 11:12:23 AM »
Unknown symbol indicates a missing kernel module on which ads7846 module depends on. Use modinfo to check dependencies.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Dirk_H

  • Newbie
  • *
  • Posts: 5
Re: Get Touchscreen with ADS7846 working
« Reply #3 on: October 19, 2016, 11:34:38 AM »
@bmarkus: I think it was you from whom I got the idea of modinfo from anoter thread :)

After a second try, I now also have the calibration working. I dont know why it didnt worked on the first run...

Code: [Select]
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event2 /usr/local/bin/ts_calibrate
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event2 /usr/local/bin/ts_test

Thanks anyhow :)

Offline jordache

  • Newbie
  • *
  • Posts: 15
Re: Get Touchscreen with ADS7846 working
« Reply #4 on: October 26, 2016, 02:54:51 PM »
hey dirk_h,
after you ran the calibration using those commands, were things working correctly when you started jivelite again?  i can run the calibration just fine using your code, but the changes don't seem to carry over into jivelite - the motion is too fast near the edges, and the X axis is inverted.  i tried filetool.sh -b after running the calibration but it still didn't help.  how did you get it to persist/work in jivelite?

Offline mff

  • Newbie
  • *
  • Posts: 7
Re: Get Touchscreen with ADS7846 working
« Reply #5 on: January 09, 2017, 11:52:03 AM »
How can I add hwmon to a piCore v8.0 system? I can't find any package available in the repository.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Get Touchscreen with ADS7846 working
« Reply #6 on: January 09, 2017, 04:44:58 PM »
hwmon is a lib service, not a standalone user program. It's already built in and working.
When you connect some hardware, it automatically check it's status and set appropriate drivers, firmware, etc.
When it reports some error in the dmesg, than there is something wrong with the driver it points to.

Offline mff

  • Newbie
  • *
  • Posts: 7
Re: Get Touchscreen with ADS7846 working
« Reply #7 on: January 10, 2017, 12:06:25 PM »
Ok, I understand.
But what was Dirk_H doing when he was writing
Quote
ads7846 needs hwmon. I finally added it to my tcz and now the touchscreen seems to work as /dev/input/event2
?
Can anybody explain the steps needed to get the ads7846 running?

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Get Touchscreen with ADS7846 working
« Reply #8 on: January 10, 2017, 03:48:06 PM »
It means, that it needs the driver, which is in the hwmon lib folder.
Everything what you need you'll find here:
http://forum.tinycorelinux.net/index.php/topic,18652.msg117800.html#msg117800
I've put there a simple script which uses the overlay for the touch screen and config for the TFT init and setup.

Offline mff

  • Newbie
  • *
  • Posts: 7
Re: Get Touchscreen with ADS7846 working
« Reply #9 on: January 11, 2017, 12:00:53 PM »
Sorry, but I can't find a working script in the "waveshare35a.zip". Tried the steps manually, but no change.
I also tried the suggestions from the other posts but the problem was to find a tft.tcz for download. The only working link was "Bandwidth Limit Exceeded".

My TFT is the 5inch HDMI version, so display is working fine, only no chance for touch driver.  :'(

Offline aeppsi

  • Newbie
  • *
  • Posts: 2
Re: Get Touchscreen with ADS7846 working
« Reply #10 on: February 02, 2017, 07:12:33 AM »
Hi there,

I'm pretty new in terms of tiny core and even linux itself. But I'm doing my best to learn asap everything i need for getting more and more familiar with it.

I'm using picoreplayer on a raspberry pi 3 and a 5 inch touchscreen (waveshare 5'' version B, means touchfunction via USB, http://www.waveshare.com/wiki/5inch_HDMI_LCD_(B)_(Firmware_Rev_2.1)_User_Manual).

Everthing is working fine except the touch pointer. The pointer is anywhere but not where the finger is. I need to calibrate it but dont know how. I did it formerly on a raspbian as described in the related waveshare wiki and it worked properly. Searching through the web the last days I could not get ahead on step.

Is there any step-by-step-how-to which I could follow? Which extensions do I need to install and how? How can I install the calibration program and run it? Where do I need to write the calibrations results to fix them?

Any kind of help is highly appreciated. And sorry if I asked questions that are already answered anywhere else. Many thanks in advance.

Offline mff

  • Newbie
  • *
  • Posts: 7
Re: Get Touchscreen with ADS7846 working
« Reply #11 on: March 13, 2017, 12:48:28 PM »
I'm still stuck. No useable tft.tcz file for the recent piCore v8.0 (linux 4.4.39-pcpCore_v7+)  :'(