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.

  • Resolved

AM335x Starter Kit Capacitive Touch Screen

Intellectual 705 points

Replies: 80

Views: 39364

Hi,

I am trying to integrate a capacitive touch screen display - NHD-5.0-800480TF-ATXI#-CTP with the starter kit under linux.

I have successfully modified the boardconfig file to get the LCD display right. Unfortunately I am having trouble with the capacitive touch screen.

The touch controller is FT5X06 and I have found some driver files, that I hope can be adapted here.

It would be great if anyone could give me pointers in integrating this, and this could serve as a solution to others trying the same.

I have adapted  the driver file and managed to compile a new kernel image. But during the driver probe, it is unable to read anything from the touch controller.(Error -121 I2C Read Reg)

I have tried to manually detect this chip at address 0x38 using i2cdetect -r 1. With the driver not added in kernel, Nothing is detected at this address. When the driver is added, a "UU" is shown at this address.

A device is registered successfully as /devices/virtual/input/input2

I am attaching the driver files and the board config file.

Thanks a lot.

Ram

7750.ft5x06_ts.c

8231.board-am335xevm.c

7357.ft5x06_ts.h

  • Hi Shiram,
     
    There is a wakeup signal - LCD_CAP_TOUCH_WAKE, going to the capacitive TS. Have you checked the state of this signal?

     

    Best Regards
    Biser
  • In reply to Biser Gatchev-XID:

    Hi Biser,

    Thanks for the quick reply.

    No, I did not check this pins state. The driver I got from https://gitorious.org/ft5x06-driver/ ignores this pin.

    Also i really dont know how the interrupt is handled here. I am just beginning to understand these things. As of now WAKE and INT is ignored.

    But for start, during the ID register read in the driver's probe function, I get this read error -121 message.

    Kernel fault code documentation pins it to a possible clock stretching issue. (http://www.mjmwired.net/kernel/Documentation/i2c/fault-codes#122)

    This bus is also shared by an EEPROM, accelerometer, power management ic and an audio ic as far as i can tell and regsitered at 100KHz.

    Thanks a lot.

    Ram

  • In reply to shriram:

    shriram
    But for start, during the ID register read in the driver's probe function, I get this read error -121 message.
    Kernel fault code documentation pins it to a possible clock stretching issue. (http://www.mjmwired.net/kernel/Documentation/i2c/fault-codes#122)
     
    There is an Errata 1.0.26 that might be related to this (http://www.ti.com/lit/er/sprz360d/sprz360d.pdf).

     

    Best Regards
    Biser
  • In reply to Biser Gatchev-XID:

    Hi Biser,

    Just measured the signals with an Oscilloscope. There is no ACK coming from the controller. I see the 3.3V.

    I tried also probing with i2cget, i2cdump and i2cdetect. I always get read failed.

    I am probing at address 0x38 and I dont get a response at all. I can see that the SDA and SCL are properly driven from the processor side, only no ACK during the 9th clock. SDA stays high at this 9th clock.

    I am quite stumped now and wondering how to proceed !

    Ram

  • In reply to shriram:

    Try driving the WAKE signal high.

     

    Best Regards
    Biser
  • In reply to Biser Gatchev-XID:

    Biser Gatchev-XID
    Try driving the WAKE signal high.

    Yes ! This helped me talk with the Controller. I am able to read the ft5x06 registers.

    Next I am trying to integrate this into the driver.

    Once the driver is regsitered properly, will it automatically be used as the default touchscreen input ?

    Thanks a lot.

    Ram

  • In reply to shriram:

    Good to hear that! I can't help you with the software, unfortunately. You may need to disable the default TSC driver. If you experience problems post on this thread, I will ask somebody from the software team to help.

     

    Best Regards
    Biser
  • In reply to Biser Gatchev-XID:

    Hi Biser,

    Thanks a lot. Now I have added a pullup resistor in the WAKE pin and the ft5x06_ts driver registers without any errors. 

    I am stil unable to get the touchscreen to work. I will detail my configuration below. If anyone from software team could guide me with this, I would be thankful.

    /proc/bus/input/devices : lists ft5x06_ts as :

    BUS=0000 Vendor=0000 Product=0000 Version=0000

    Name="ft5x06_ts"

    phys=

    systs=/devices/virtual/input/input1

    Uniq=

    Handlers=event1

    PROP=0

    EV=b

    KEY=0

    ABS=650000 0

    I modified the matrixgui service script in init.d to export  TSLIB_TSDEVICE=/dev/input/event1.

    There are no modifications in driver code and board config since i uploaded first in this thread.

    Thanks a lot

    Ram

  • In reply to shriram:

    Hi shriram,

    Here is the output of cat /proc/bus/input/devices when using the default TI touchscreen driver:

    I: Bus=0000 Vendor=0000 Product=0000 Version=0000
    N: Name="ti-tsc"
    P: Phys=
    S: Sysfs=/devices/platform/omap/ti_tscadc/tsc/input/input2
    U: Uniq=
    H: Handlers=mouse0 event2
    B: PROP=0
    B: EV=b
    B: KEY=400 0 0 0 0 0 0 0 0 0 0
    B: ABS=1000003

    Your output seems ok, except for that you have no mouse handler, but I don't think this is it.

    Please try:

    cat /dev/input/event1

    and see if you get any gibberish output in the console.

    Best regards,
    Miroslav


    --------------------------------------------------------------------------------------------------------------------------------
    Note: If this post answers your question, please click the Verify Answer button below. Thank you!
    --------------------------------------------------------------------------------------------------------------------------------
  • In reply to Miroslav Kiradzhiyski XID:

    Hi Miroslav,

    Thanks for the fast reply.

    cat /dev/input/event1 did not give out any data ( I also tried touching the screen many times).

    I tried "evtest /dev/input/event1" and get

    driver version 1.0.1

    device id: bus 0x0 vendor 0x0 product 0x0 version 0x0

    device name : "ft5x06_ts"

    supported events:

    Event type 0 (Sync)

    Event type 1 (key)

    Event type 3 (Absolute)

     Event code 48 (Touch Major) Value 0 Min 0 Max 255

     Event code 50 (width Major) Value 0 Min 0 Max 200

     Event code 53 (Position X) Value 0 Min 0 Max 800

     Event code 54 (Position Y) Value 0 Min 0 Max 480

    Testing ... (interrupt to exit)

    and then nothing else. (Also tried here touching the screen many times).

    I inserted some printk inside the driver function "ft5x0x_ts_pen_irq_work" as it is being assigned in INIT_WORK, but these statements do not get printed at all in /var/log/messages. The last ft5x06 related message here is from the probe function.

    Also "ps" does not reveal any worker thread related to this driver.

    Thanks a lot.

    Ram

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.